diff options
author | Peter Huewe <peterhuewe@gmx.de> | 2010-04-27 00:34:49 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-11 11:35:43 -0700 |
commit | f4d52b072d35ad2cc3720af65853e6fcc9d8414f (patch) | |
tree | 2bd2a3f89b313beeca71f472efd5929fa71cd195 /drivers/staging/otus/ioctl.c | |
parent | b4001982bcd79e9685bc09f68a05526f8c5887c7 (diff) |
Staging: otus: Add null check and fix coding style issue
This patch removes mixing of declarations and code and adds a null-test
after a kmalloc.
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/otus/ioctl.c')
-rw-r--r-- | 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 b9dd943e07a1..a48c8e4a9ea7 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 |