Commit cc60d8ba authored by Mariusz Kozlowski's avatar Mariusz Kozlowski Committed by Bartlomiej Zolnierkiewicz

drivers/ide/arm/icside.c: kmalloc + memset conversion to kzalloc

Is this a bug? In original verison memset cleared sizeof(state) bytes
instead of sizeof(*state). If it was intentional then this patch is invalid.
If not intentional -> valid :) Please review.

Bart: Yes, it is a bug so this patch is a valid bugfix. :-)

 drivers/ide/arm/icside.c | 18883 -> 18849 (-34 bytes)
Signed-off-by: default avatarMariusz Kozlowski <m.kozlowski@tuxland.pl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent ab057968
...@@ -693,13 +693,12 @@ icside_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -693,13 +693,12 @@ icside_probe(struct expansion_card *ec, const struct ecard_id *id)
if (ret) if (ret)
goto out; goto out;
state = kmalloc(sizeof(struct icside_state), GFP_KERNEL); state = kzalloc(sizeof(struct icside_state), GFP_KERNEL);
if (!state) { if (!state) {
ret = -ENOMEM; ret = -ENOMEM;
goto release; goto release;
} }
memset(state, 0, sizeof(state));
state->type = ICS_TYPE_NOTYPE; state->type = ICS_TYPE_NOTYPE;
state->dev = &ec->dev; state->dev = &ec->dev;
......
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