]> git.sur5r.net Git - u-boot/commitdiff
usb:composite: clear the whole common buffer
authorJeroen Hofstee <jeroen@myspectrum.nl>
Mon, 9 Jun 2014 13:28:59 +0000 (15:28 +0200)
committerMarek Vasut <marex@denx.de>
Wed, 25 Jun 2014 20:42:07 +0000 (22:42 +0200)
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>
drivers/usb/gadget/f_mass_storage.c

index 6374bb953a94478bbf469b09b52756e18796fac4..f274d9679fb95747988accf9b75e8d0c110270c9 100644 (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;
        }