aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevendra Naga <devendra.aaru@gmail.com>2012-07-14 03:41:59 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-16 22:21:37 -0400
commit1a46eafe1c4a2bf45928beb280b378f5af904ed9 (patch)
treeb8c2650d22e27b62625cfb46dd739c1bef31d1d9
parent6594ac5dead7ad7cd10103d147eda3190fd49cad (diff)
staging/wlan-ng: use kzalloc rather using kmalloc at create_wlan
instead we would have used kzalloc, so our memory which is allocated will be set to 0. codepath: the code path here is prism2sta_probe_usb, calling when ever usb-dev id and usb-vendor id e.t.c matches with what ever present in the MODULE_DEVICE_TABLE, and in prism2sta_probe_usb , we call create_wlan, and its called nowhere else... Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/wlan-ng/prism2sta.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c
index 417aea5e01cd..1dfd9aa5e9fe 100644
--- a/drivers/staging/wlan-ng/prism2sta.c
+++ b/drivers/staging/wlan-ng/prism2sta.c
@@ -1947,8 +1947,8 @@ static wlandevice_t *create_wlan(void)
1947 hfa384x_t *hw = NULL; 1947 hfa384x_t *hw = NULL;
1948 1948
1949 /* Alloc our structures */ 1949 /* Alloc our structures */
1950 wlandev = kmalloc(sizeof(wlandevice_t), GFP_KERNEL); 1950 wlandev = kzalloc(sizeof(wlandevice_t), GFP_KERNEL);
1951 hw = kmalloc(sizeof(hfa384x_t), GFP_KERNEL); 1951 hw = kzalloc(sizeof(hfa384x_t), GFP_KERNEL);
1952 1952
1953 if (!wlandev || !hw) { 1953 if (!wlandev || !hw) {
1954 printk(KERN_ERR "%s: Memory allocation failure.\n", dev_info); 1954 printk(KERN_ERR "%s: Memory allocation failure.\n", dev_info);
@@ -1957,10 +1957,6 @@ static wlandevice_t *create_wlan(void)
1957 return NULL; 1957 return NULL;
1958 } 1958 }
1959 1959
1960 /* Clear all the structs */
1961 memset(wlandev, 0, sizeof(wlandevice_t));
1962 memset(hw, 0, sizeof(hfa384x_t));
1963
1964 /* Initialize the network device object. */ 1960 /* Initialize the network device object. */
1965 wlandev->nsdname = dev_info; 1961 wlandev->nsdname = dev_info;
1966 wlandev->msdstate = WLAN_MSD_HWPRESENT_PENDING; 1962 wlandev->msdstate = WLAN_MSD_HWPRESENT_PENDING;