Skip to content

Commit

Permalink
rndis_wlan: use kzalloc to allocate private data
Browse files Browse the repository at this point in the history
rndis_wlan used kmalloc to allocate private data structure and leaving data
uninitialized, but later assumed to be set zero.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Jussi Kivilinna authored and John W. Linville committed Jun 14, 2008
1 parent 8d5e0d5 commit bb8649d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/wireless/rndis_wlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2522,16 +2522,14 @@ static int rndis_wext_bind(struct usbnet *usbdev, struct usb_interface *intf)
__le32 tmp;

/* allocate rndis private data */
priv = kmalloc(sizeof(struct rndis_wext_private), GFP_KERNEL);
priv = kzalloc(sizeof(struct rndis_wext_private), GFP_KERNEL);
if (!priv)
return -ENOMEM;

/* These have to be initialized before calling generic_rndis_bind().
* Otherwise we'll be in big trouble in rndis_wext_early_init().
*/
usbdev->driver_priv = priv;
memset(priv, 0, sizeof(*priv));
memset(priv->name, 0, sizeof(priv->name));
strcpy(priv->name, "IEEE802.11");
usbdev->net->wireless_handlers = &rndis_iw_handlers;
priv->usbdev = usbdev;
Expand Down

0 comments on commit bb8649d

Please sign in to comment.