summaryrefslogtreecommitdiffstats
path: root/drivers/ptp
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2022-06-08 15:03:58 +0300
committerJakub Kicinski <kuba@kernel.org>2022-06-10 08:36:08 -0700
commit9a7a1be6b618fb1c73f497c7f465dd355dca0b13 (patch)
treedb91fa679917d3e036848a3668450a68da020ee9 /drivers/ptp
parent0fb0bf7a8c751b39b63456b04a74dee3ecfd2204 (diff)
downloadlinux-stable-9a7a1be6b618fb1c73f497c7f465dd355dca0b13.tar.gz
linux-stable-9a7a1be6b618fb1c73f497c7f465dd355dca0b13.tar.bz2
linux-stable-9a7a1be6b618fb1c73f497c7f465dd355dca0b13.zip
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Vadim Fedorenko <vfedorenko@novek.ru> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/ptp')
-rw-r--r--drivers/ptp/ptp_ocp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index d92d7e42667c..e59ea2173aac 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -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;