From: Mariusz Kozlowski Date: Wed, 1 Aug 2007 21:46:44 +0000 (+0200) Subject: drivers/ide/arm/icside.c: kmalloc + memset conversion to kzalloc X-Git-Tag: v2.6.23-rc2~23^2~7 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc60d8baa35c995bf8c40a9730b894993ddb43b9;p=linux-2.6 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: Mariusz Kozlowski Cc: Andrew Morton Cc: Russell King Signed-off-by: Bartlomiej Zolnierkiewicz --- diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c index c89b5f4b2d..8a9b98fcb6 100644 --- a/drivers/ide/arm/icside.c +++ b/drivers/ide/arm/icside.c @@ -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;