aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1/w1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/w1/w1.c')
-rw-r--r--drivers/w1/w1.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index c6332108f1c5..8d7ab74170d5 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -520,7 +520,7 @@ static int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
520 int err; 520 int err;
521 struct w1_netlink_msg msg; 521 struct w1_netlink_msg msg;
522 522
523 sl = kmalloc(sizeof(struct w1_slave), GFP_KERNEL); 523 sl = kzalloc(sizeof(struct w1_slave), GFP_KERNEL);
524 if (!sl) { 524 if (!sl) {
525 dev_err(&dev->dev, 525 dev_err(&dev->dev,
526 "%s: failed to allocate new slave device.\n", 526 "%s: failed to allocate new slave device.\n",
@@ -528,7 +528,6 @@ static int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
528 return -ENOMEM; 528 return -ENOMEM;
529 } 529 }
530 530
531 memset(sl, 0, sizeof(*sl));
532 531
533 sl->owner = THIS_MODULE; 532 sl->owner = THIS_MODULE;
534 sl->master = dev; 533 sl->master = dev;