Commit ad96f37f authored by Tapasweni Pathak's avatar Tapasweni Pathak Committed by Greg Kroah-Hartman

staging: wlan-ng: replace kmalloc and memset with kzalloc

Replace kmalloc and memset with a single call of kzalloc in
file of wlan-ng.
Signed-off-by: default avatarTapasweni Pathak <tapaswenipathak@gmail.com>
Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 646da830
...@@ -986,8 +986,8 @@ static int writeimage(wlandevice_t *wlandev, struct imgchunk *fchunk, ...@@ -986,8 +986,8 @@ static int writeimage(wlandevice_t *wlandev, struct imgchunk *fchunk,
u32 currlen; u32 currlen;
u32 currdaddr; u32 currdaddr;
rstmsg = kmalloc(sizeof(*rstmsg), GFP_KERNEL); rstmsg = kzalloc(sizeof(*rstmsg), GFP_KERNEL);
rwrmsg = kmalloc(sizeof(*rwrmsg), GFP_KERNEL); rwrmsg = kzalloc(sizeof(*rwrmsg), GFP_KERNEL);
if (!rstmsg || !rwrmsg) { if (!rstmsg || !rwrmsg) {
kfree(rstmsg); kfree(rstmsg);
kfree(rwrmsg); kfree(rwrmsg);
...@@ -997,7 +997,6 @@ static int writeimage(wlandevice_t *wlandev, struct imgchunk *fchunk, ...@@ -997,7 +997,6 @@ static int writeimage(wlandevice_t *wlandev, struct imgchunk *fchunk,
} }
/* Initialize the messages */ /* Initialize the messages */
memset(rstmsg, 0, sizeof(*rstmsg));
strcpy(rstmsg->devname, wlandev->name); strcpy(rstmsg->devname, wlandev->name);
rstmsg->msgcode = DIDmsg_p2req_ramdl_state; rstmsg->msgcode = DIDmsg_p2req_ramdl_state;
rstmsg->msglen = sizeof(*rstmsg); rstmsg->msglen = sizeof(*rstmsg);
...@@ -1011,7 +1010,6 @@ static int writeimage(wlandevice_t *wlandev, struct imgchunk *fchunk, ...@@ -1011,7 +1010,6 @@ static int writeimage(wlandevice_t *wlandev, struct imgchunk *fchunk,
rstmsg->exeaddr.len = sizeof(u32); rstmsg->exeaddr.len = sizeof(u32);
rstmsg->resultcode.len = sizeof(u32); rstmsg->resultcode.len = sizeof(u32);
memset(rwrmsg, 0, sizeof(*rwrmsg));
strcpy(rwrmsg->devname, wlandev->name); strcpy(rwrmsg->devname, wlandev->name);
rwrmsg->msgcode = DIDmsg_p2req_ramdl_write; rwrmsg->msgcode = DIDmsg_p2req_ramdl_write;
rwrmsg->msglen = sizeof(*rwrmsg); rwrmsg->msglen = sizeof(*rwrmsg);
......
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