projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0fb0bf7
)
ptp_ocp: replace kzalloc(x*y) by kcalloc(y, x)
author
Andy Shevchenko
<andriy.shevchenko@linux.intel.com>
Wed, 8 Jun 2022 12:03:58 +0000
(15:03 +0300)
committer
Jakub 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
patch
|
blob
|
history
diff --git
a/drivers/ptp/ptp_ocp.c
b/drivers/ptp/ptp_ocp.c
index d92d7e42667c5a1f3e60e3d4550e73142faa74ee..e59ea2173aac88786c319e9364847c7a2d503629 100644
(file)
--- 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 = k
zalloc(sizeof(*config) * 4
, GFP_KERNEL);
+ config = k
calloc(4, sizeof(*config)
, GFP_KERNEL);
if (!config)
return -ENOMEM;