diff options
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/mcp-core.c | 3 | ||||
-rw-r--r-- | drivers/mfd/ucb1x00-core.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mfd/mcp-core.c b/drivers/mfd/mcp-core.c index 75f401d52fda..b4ed57e02729 100644 --- a/drivers/mfd/mcp-core.c +++ b/drivers/mfd/mcp-core.c | |||
@@ -200,9 +200,8 @@ struct mcp *mcp_host_alloc(struct device *parent, size_t size) | |||
200 | { | 200 | { |
201 | struct mcp *mcp; | 201 | struct mcp *mcp; |
202 | 202 | ||
203 | mcp = kmalloc(sizeof(struct mcp) + size, GFP_KERNEL); | 203 | mcp = kzalloc(sizeof(struct mcp) + size, GFP_KERNEL); |
204 | if (mcp) { | 204 | if (mcp) { |
205 | memset(mcp, 0, sizeof(struct mcp) + size); | ||
206 | spin_lock_init(&mcp->lock); | 205 | spin_lock_init(&mcp->lock); |
207 | mcp->attached_device.parent = parent; | 206 | mcp->attached_device.parent = parent; |
208 | mcp->attached_device.bus = &mcp_bus_type; | 207 | mcp->attached_device.bus = &mcp_bus_type; |
diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c index 149810a084f5..e03f1bcd4f9f 100644 --- a/drivers/mfd/ucb1x00-core.c +++ b/drivers/mfd/ucb1x00-core.c | |||
@@ -484,12 +484,11 @@ static int ucb1x00_probe(struct mcp *mcp) | |||
484 | goto err_disable; | 484 | goto err_disable; |
485 | } | 485 | } |
486 | 486 | ||
487 | ucb = kmalloc(sizeof(struct ucb1x00), GFP_KERNEL); | 487 | ucb = kzalloc(sizeof(struct ucb1x00), GFP_KERNEL); |
488 | ret = -ENOMEM; | 488 | ret = -ENOMEM; |
489 | if (!ucb) | 489 | if (!ucb) |
490 | goto err_disable; | 490 | goto err_disable; |
491 | 491 | ||
492 | memset(ucb, 0, sizeof(struct ucb1x00)); | ||
493 | 492 | ||
494 | ucb->cdev.class = &ucb1x00_class; | 493 | ucb->cdev.class = &ucb1x00_class; |
495 | ucb->cdev.dev = &mcp->attached_device; | 494 | ucb->cdev.dev = &mcp->attached_device; |