diff options
author | Jeroen Hofstee <jeroen@myspectrum.nl> | 2014-06-09 15:28:59 +0200 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2014-06-25 22:42:07 +0200 |
commit | 933611f7bbeb1b29218dca74cf1acfa910006cef (patch) | |
tree | dc6be457d86024f3827a1076723cb884995c5a2d /drivers | |
parent | 198c5f998a1fbbdb5cfe6035f8c890ffb1526d8e (diff) | |
download | u-boot-imx-933611f7bbeb1b29218dca74cf1acfa910006cef.zip u-boot-imx-933611f7bbeb1b29218dca74cf1acfa910006cef.tar.gz u-boot-imx-933611f7bbeb1b29218dca74cf1acfa910006cef.tar.bz2 |
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 <l.majewski@samsung.com>
cc: Piotr Wilczek <p.wilczek@samsung.com>
cc: Kyungmin Park <kyungmin.park@samsung.com>
cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/gadget/f_mass_storage.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c index 6374bb9..f274d96 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; } |