]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ptp_ocp: replace kzalloc(x*y) by kcalloc(y, x)
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 8 Jun 2022 12:03:58 +0000 (15:03 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 10 Jun 2022 15:36:08 +0000 (08:36 -0700)
While here it may be no difference, the kcalloc() has some checks
against overflow and it's logically correct to call it for an array.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Vadim Fedorenko <vfedorenko@novek.ru>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/ptp/ptp_ocp.c

index d92d7e42667c5a1f3e60e3d4550e73142faa74ee..e59ea2173aac88786c319e9364847c7a2d503629 100644 (file)
@@ -2155,7 +2155,7 @@ ptp_ocp_fb_set_pins(struct ptp_ocp *bp)
        struct ptp_pin_desc *config;
        int i;
 
-       config = kzalloc(sizeof(*config) * 4, GFP_KERNEL);
+       config = kcalloc(4, sizeof(*config), GFP_KERNEL);
        if (!config)
                return -ENOMEM;