Commit 933611f7bbeb1b29218dca74cf1acfa910006cef
Committed by
Marek Vasut
1 parent
198c5f998a
Exists in
v2017.01-smarct4x
and in
40 other branches
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>
Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff
drivers/usb/gadget/f_mass_storage.c
... | ... | @@ -2462,12 +2462,12 @@ |
2462 | 2462 | |
2463 | 2463 | /* Allocate? */ |
2464 | 2464 | if (!common) { |
2465 | - common = calloc(sizeof *common, 1); | |
2465 | + common = calloc(sizeof(*common), 1); | |
2466 | 2466 | if (!common) |
2467 | 2467 | return ERR_PTR(-ENOMEM); |
2468 | 2468 | common->free_storage_on_release = 1; |
2469 | 2469 | } else { |
2470 | - memset(common, 0, sizeof common); | |
2470 | + memset(common, 0, sizeof(*common)); | |
2471 | 2471 | common->free_storage_on_release = 0; |
2472 | 2472 | } |
2473 | 2473 |