aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1/w1_int.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/w1/w1_int.c')
-rw-r--r--drivers/w1/w1_int.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c
index 258defdb2efd..2fbd8dd16df5 100644
--- a/drivers/w1/w1_int.c
+++ b/drivers/w1/w1_int.c
@@ -41,7 +41,7 @@ static struct w1_master * w1_alloc_dev(u32 id, int slave_count, int slave_ttl,
41 /* 41 /*
42 * We are in process context(kernel thread), so can sleep. 42 * We are in process context(kernel thread), so can sleep.
43 */ 43 */
44 dev = kmalloc(sizeof(struct w1_master) + sizeof(struct w1_bus_master), GFP_KERNEL); 44 dev = kzalloc(sizeof(struct w1_master) + sizeof(struct w1_bus_master), GFP_KERNEL);
45 if (!dev) { 45 if (!dev) {
46 printk(KERN_ERR 46 printk(KERN_ERR
47 "Failed to allocate %zd bytes for new w1 device.\n", 47 "Failed to allocate %zd bytes for new w1 device.\n",
@@ -49,7 +49,6 @@ static struct w1_master * w1_alloc_dev(u32 id, int slave_count, int slave_ttl,
49 return NULL; 49 return NULL;
50 } 50 }
51 51
52 memset(dev, 0, sizeof(struct w1_master) + sizeof(struct w1_bus_master));
53 52
54 dev->bus_master = (struct w1_bus_master *)(dev + 1); 53 dev->bus_master = (struct w1_bus_master *)(dev + 1);
55 54