aboutsummaryrefslogtreecommitdiffstats
path: root/net/wanrouter/af_wanpipe.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wanrouter/af_wanpipe.c')
-rw-r--r--net/wanrouter/af_wanpipe.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/net/wanrouter/af_wanpipe.c b/net/wanrouter/af_wanpipe.c
index b1265187b4a8..6f39faa15832 100644
--- a/net/wanrouter/af_wanpipe.c
+++ b/net/wanrouter/af_wanpipe.c
@@ -32,7 +32,6 @@
32* 32*
33******************************************************************************/ 33******************************************************************************/
34 34
35#include <linux/config.h>
36#include <linux/types.h> 35#include <linux/types.h>
37#include <linux/sched.h> 36#include <linux/sched.h>
38#include <linux/mm.h> 37#include <linux/mm.h>
@@ -371,12 +370,11 @@ static int wanpipe_listen_rcv (struct sk_buff *skb, struct sock *sk)
371 * used by the ioctl call to read call information 370 * used by the ioctl call to read call information
372 * and to execute commands. 371 * and to execute commands.
373 */ 372 */
374 if ((mbox_ptr = kmalloc(sizeof(mbox_cmd_t), GFP_ATOMIC)) == NULL) { 373 if ((mbox_ptr = kzalloc(sizeof(mbox_cmd_t), GFP_ATOMIC)) == NULL) {
375 wanpipe_kill_sock_irq (newsk); 374 wanpipe_kill_sock_irq (newsk);
376 release_device(dev); 375 release_device(dev);
377 return -ENOMEM; 376 return -ENOMEM;
378 } 377 }
379 memset(mbox_ptr, 0, sizeof(mbox_cmd_t));
380 memcpy(mbox_ptr,skb->data,skb->len); 378 memcpy(mbox_ptr,skb->data,skb->len);
381 379
382 /* Register the lcn on which incoming call came 380 /* Register the lcn on which incoming call came
@@ -508,11 +506,10 @@ static struct sock *wanpipe_alloc_socket(void)
508 if ((sk = sk_alloc(PF_WANPIPE, GFP_ATOMIC, &wanpipe_proto, 1)) == NULL) 506 if ((sk = sk_alloc(PF_WANPIPE, GFP_ATOMIC, &wanpipe_proto, 1)) == NULL)
509 return NULL; 507 return NULL;
510 508
511 if ((wan_opt = kmalloc(sizeof(struct wanpipe_opt), GFP_ATOMIC)) == NULL) { 509 if ((wan_opt = kzalloc(sizeof(struct wanpipe_opt), GFP_ATOMIC)) == NULL) {
512 sk_free(sk); 510 sk_free(sk);
513 return NULL; 511 return NULL;
514 } 512 }
515 memset(wan_opt, 0x00, sizeof(struct wanpipe_opt));
516 513
517 wp_sk(sk) = wan_opt; 514 wp_sk(sk) = wan_opt;
518 515
@@ -2012,10 +2009,9 @@ static int set_ioctl_cmd (struct sock *sk, void *arg)
2012 2009
2013 dev_put(dev); 2010 dev_put(dev);
2014 2011
2015 if ((mbox_ptr = kmalloc(sizeof(mbox_cmd_t), GFP_ATOMIC)) == NULL) 2012 if ((mbox_ptr = kzalloc(sizeof(mbox_cmd_t), GFP_ATOMIC)) == NULL)
2016 return -ENOMEM; 2013 return -ENOMEM;
2017 2014
2018 memset(mbox_ptr, 0, sizeof(mbox_cmd_t));
2019 wp_sk(sk)->mbox = mbox_ptr; 2015 wp_sk(sk)->mbox = mbox_ptr;
2020 2016
2021 wanpipe_link_driver(dev,sk); 2017 wanpipe_link_driver(dev,sk);