Commit f4d52b07 authored by Peter Huewe's avatar Peter Huewe Committed by Greg Kroah-Hartman

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: default avatarPeter Huewe <peterhuewe@gmx.de>
Acked-by: default avatarSimon Horman <horms@verge.net.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b4001982
...@@ -867,6 +867,7 @@ int usbdrvwext_giwscan(struct net_device *dev, ...@@ -867,6 +867,7 @@ int usbdrvwext_giwscan(struct net_device *dev,
char *current_ev = extra; char *current_ev = extra;
char *end_buf; char *end_buf;
int i; int i;
struct zsBssListV1 *pBssList;
/* BssList = wd->sta.pBssList; */ /* BssList = wd->sta.pBssList; */
/* zmw_get_wlan_dev(dev); */ /* zmw_get_wlan_dev(dev); */
...@@ -874,8 +875,10 @@ int usbdrvwext_giwscan(struct net_device *dev, ...@@ -874,8 +875,10 @@ int usbdrvwext_giwscan(struct net_device *dev,
return 0; return 0;
/* struct zsBssList BssList; */ /* struct zsBssList BssList; */
struct zsBssListV1 *pBssList = kmalloc(sizeof(struct zsBssListV1), pBssList = kmalloc(sizeof(struct zsBssListV1), GFP_KERNEL);
GFP_KERNEL); if (pBssList == NULL)
return -ENOMEM;
if (data->length == 0) if (data->length == 0)
end_buf = extra + IW_SCAN_MAX_DATA; end_buf = extra + IW_SCAN_MAX_DATA;
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment