From: Jeroen Hofstee Date: Mon, 9 Jun 2014 13:28:59 +0000 (+0200) Subject: usb:composite: clear the whole common buffer X-Git-Tag: v2014.07-rc4~14 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=933611f7bbeb1b29218dca74cf1acfa910006cef;p=u-boot usb:composite: clear the whole common buffer Since the struct fsg_common is calloced, reset it completely with zero's when reused. While at it, make checkpatch happy. cc: Lukasz Majewski cc: Piotr Wilczek cc: Kyungmin Park cc: Marek Vasut Signed-off-by: Jeroen Hofstee Acked-by: Marek Vasut Acked-by: Lukasz Majewski --- diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c index 6374bb953a..f274d9679f 100644 --- a/drivers/usb/gadget/f_mass_storage.c +++ b/drivers/usb/gadget/f_mass_storage.c @@ -2462,12 +2462,12 @@ static struct fsg_common *fsg_common_init(struct fsg_common *common, /* Allocate? */ if (!common) { - common = calloc(sizeof *common, 1); + common = calloc(sizeof(*common), 1); if (!common) return ERR_PTR(-ENOMEM); common->free_storage_on_release = 1; } else { - memset(common, 0, sizeof common); + memset(common, 0, sizeof(*common)); common->free_storage_on_release = 0; }