mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-27 06:04:40 +08:00
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:
parent
198c5f998a
commit
933611f7bb
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user