]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ethernet: ucc_geth: replace kmalloc+memset by kzalloc
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Tue, 19 Jan 2021 15:07:52 +0000 (16:07 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 21 Jan 2021 20:19:55 +0000 (12:19 -0800)
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/ucc_geth.c

index be997b559577039a5bc830c03e004d0d71e5998a..74ee2ed2fbbb65c44f688801efe409a3d18be5cb 100644 (file)
@@ -2904,14 +2904,11 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
         * allocated resources can be released when the channel is freed.
         */
        if (!(ugeth->p_init_enet_param_shadow =
-             kmalloc(sizeof(struct ucc_geth_init_pram), GFP_KERNEL))) {
+             kzalloc(sizeof(struct ucc_geth_init_pram), GFP_KERNEL))) {
                if (netif_msg_ifup(ugeth))
                        pr_err("Can not allocate memory for p_UccInitEnetParamShadows\n");
                return -ENOMEM;
        }
-       /* Zero out *p_init_enet_param_shadow */
-       memset((char *)ugeth->p_init_enet_param_shadow,
-              0, sizeof(struct ucc_geth_init_pram));
 
        /* Fill shadow InitEnet command parameter structure */