Commit 9a7a1be6 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jakub Kicinski

ptp_ocp: replace kzalloc(x*y) by kcalloc(y, x)

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarVadim Fedorenko <vfedorenko@novek.ru>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 0fb0bf7a
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment