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>
This commit is contained in:
Jeroen Hofstee 2014-06-09 15:28:59 +02:00 committed by Marek Vasut
parent 198c5f998a
commit 933611f7bb

View File

@ -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;
}