* [PATCH] staging/otus: Add null check and fix coding style issue
@ 2010-04-26 22:34 ` Peter Huewe
0 siblings, 0 replies; 4+ messages in thread
From: Peter Huewe @ 2010-04-26 22:34 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: David Binderman, D Pranith Kumar, Alexander Beregalov,
Simon Horman, devel, linux-kernel, kernel-janitors
From: Peter Huewe <peterhuewe@gmx.de>
This patch removes mixing of declarations and code and adds a null-test
after a kmalloc.
Patch against linux-next as of 20100427
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
---
drivers/staging/otus/ioctl.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/otus/ioctl.c b/drivers/staging/otus/ioctl.c
index 84be4b2..cface46 100644
--- a/drivers/staging/otus/ioctl.c
+++ b/drivers/staging/otus/ioctl.c
@@ -867,6 +867,7 @@ int usbdrvwext_giwscan(struct net_device *dev,
char *current_ev = extra;
char *end_buf;
int i;
+ struct zsBssListV1 *pBssList;
/* BssList = wd->sta.pBssList; */
/* zmw_get_wlan_dev(dev); */
@@ -874,8 +875,10 @@ int usbdrvwext_giwscan(struct net_device *dev,
return 0;
/* struct zsBssList BssList; */
- struct zsBssListV1 *pBssList = kmalloc(sizeof(struct zsBssListV1),
- GFP_KERNEL);
+ pBssList = kmalloc(sizeof(struct zsBssListV1), GFP_KERNEL);
+ if (pBssList == NULL)
+ return -ENOMEM;
+
if (data->length == 0)
end_buf = extra + IW_SCAN_MAX_DATA;
else
--
1.6.4.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] staging/otus: Add null check and fix coding style issue
@ 2010-04-26 22:34 ` Peter Huewe
0 siblings, 0 replies; 4+ messages in thread
From: Peter Huewe @ 2010-04-26 22:34 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: David Binderman, D Pranith Kumar, Alexander Beregalov,
Simon Horman, devel, linux-kernel, kernel-janitors
From: Peter Huewe <peterhuewe@gmx.de>
This patch removes mixing of declarations and code and adds a null-test
after a kmalloc.
Patch against linux-next as of 20100427
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
---
drivers/staging/otus/ioctl.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/otus/ioctl.c b/drivers/staging/otus/ioctl.c
index 84be4b2..cface46 100644
--- a/drivers/staging/otus/ioctl.c
+++ b/drivers/staging/otus/ioctl.c
@@ -867,6 +867,7 @@ int usbdrvwext_giwscan(struct net_device *dev,
char *current_ev = extra;
char *end_buf;
int i;
+ struct zsBssListV1 *pBssList;
/* BssList = wd->sta.pBssList; */
/* zmw_get_wlan_dev(dev); */
@@ -874,8 +875,10 @@ int usbdrvwext_giwscan(struct net_device *dev,
return 0;
/* struct zsBssList BssList; */
- struct zsBssListV1 *pBssList = kmalloc(sizeof(struct zsBssListV1),
- GFP_KERNEL);
+ pBssList = kmalloc(sizeof(struct zsBssListV1), GFP_KERNEL);
+ if (pBssList = NULL)
+ return -ENOMEM;
+
if (data->length = 0)
end_buf = extra + IW_SCAN_MAX_DATA;
else
--
1.6.4.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] staging/otus: Add null check and fix coding style issue
2010-04-26 22:34 ` Peter Huewe
@ 2010-04-27 8:16 ` Simon Horman
-1 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2010-04-27 8:16 UTC (permalink / raw)
To: Peter Huewe
Cc: Greg Kroah-Hartman, David Binderman, D Pranith Kumar,
Alexander Beregalov, devel, linux-kernel, kernel-janitors
On Tue, Apr 27, 2010 at 12:34:49AM +0200, Peter Huewe wrote:
> From: Peter Huewe <peterhuewe@gmx.de>
>
> This patch removes mixing of declarations and code and adds a null-test
> after a kmalloc.
>
> Patch against linux-next as of 20100427
>
> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Acked-by: Simon Horman <horms@verge.net.au>
> ---
> drivers/staging/otus/ioctl.c | 7 +++++--
> 1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/otus/ioctl.c b/drivers/staging/otus/ioctl.c
> index 84be4b2..cface46 100644
> --- a/drivers/staging/otus/ioctl.c
> +++ b/drivers/staging/otus/ioctl.c
> @@ -867,6 +867,7 @@ int usbdrvwext_giwscan(struct net_device *dev,
> char *current_ev = extra;
> char *end_buf;
> int i;
> + struct zsBssListV1 *pBssList;
> /* BssList = wd->sta.pBssList; */
> /* zmw_get_wlan_dev(dev); */
>
> @@ -874,8 +875,10 @@ int usbdrvwext_giwscan(struct net_device *dev,
> return 0;
>
> /* struct zsBssList BssList; */
> - struct zsBssListV1 *pBssList = kmalloc(sizeof(struct zsBssListV1),
> - GFP_KERNEL);
> + pBssList = kmalloc(sizeof(struct zsBssListV1), GFP_KERNEL);
> + if (pBssList == NULL)
> + return -ENOMEM;
> +
> if (data->length == 0)
> end_buf = extra + IW_SCAN_MAX_DATA;
> else
> --
> 1.6.4.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging/otus: Add null check and fix coding style issue
@ 2010-04-27 8:16 ` Simon Horman
0 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2010-04-27 8:16 UTC (permalink / raw)
To: Peter Huewe
Cc: Greg Kroah-Hartman, David Binderman, D Pranith Kumar,
Alexander Beregalov, devel, linux-kernel, kernel-janitors
On Tue, Apr 27, 2010 at 12:34:49AM +0200, Peter Huewe wrote:
> From: Peter Huewe <peterhuewe@gmx.de>
>
> This patch removes mixing of declarations and code and adds a null-test
> after a kmalloc.
>
> Patch against linux-next as of 20100427
>
> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Acked-by: Simon Horman <horms@verge.net.au>
> ---
> drivers/staging/otus/ioctl.c | 7 +++++--
> 1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/otus/ioctl.c b/drivers/staging/otus/ioctl.c
> index 84be4b2..cface46 100644
> --- a/drivers/staging/otus/ioctl.c
> +++ b/drivers/staging/otus/ioctl.c
> @@ -867,6 +867,7 @@ int usbdrvwext_giwscan(struct net_device *dev,
> char *current_ev = extra;
> char *end_buf;
> int i;
> + struct zsBssListV1 *pBssList;
> /* BssList = wd->sta.pBssList; */
> /* zmw_get_wlan_dev(dev); */
>
> @@ -874,8 +875,10 @@ int usbdrvwext_giwscan(struct net_device *dev,
> return 0;
>
> /* struct zsBssList BssList; */
> - struct zsBssListV1 *pBssList = kmalloc(sizeof(struct zsBssListV1),
> - GFP_KERNEL);
> + pBssList = kmalloc(sizeof(struct zsBssListV1), GFP_KERNEL);
> + if (pBssList = NULL)
> + return -ENOMEM;
> +
> if (data->length = 0)
> end_buf = extra + IW_SCAN_MAX_DATA;
> else
> --
> 1.6.4.4
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-04-27 8:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-26 22:34 [PATCH] staging/otus: Add null check and fix coding style issue Peter Huewe
2010-04-26 22:34 ` Peter Huewe
2010-04-27 8:16 ` Simon Horman
2010-04-27 8:16 ` Simon Horman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.