Skip to content

Commit

Permalink
drivers/ide/arm/icside.c: kmalloc + memset conversion to kzalloc
Browse files Browse the repository at this point in the history
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: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Mariusz Kozlowski authored and Bartlomiej Zolnierkiewicz committed Aug 1, 2007
1 parent ab05796 commit cc60d8b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/ide/arm/icside.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,13 +693,12 @@ icside_probe(struct expansion_card *ec, const struct ecard_id *id)
if (ret)
goto out;

state = kmalloc(sizeof(struct icside_state), GFP_KERNEL);
state = kzalloc(sizeof(struct icside_state), GFP_KERNEL);
if (!state) {
ret = -ENOMEM;
goto release;
}

memset(state, 0, sizeof(state));
state->type = ICS_TYPE_NOTYPE;
state->dev = &ec->dev;

Expand Down

0 comments on commit cc60d8b

Please sign in to comment.