Re: [PATCH 2/4] ptp: use kcalloc/kmallco_array when allocating arrays

2017-02-14 Thread Richard Cochran
On Mon, Feb 13, 2017 at 07:51:06PM -0800, Dmitry Torokhov wrote: > @@ -269,13 +269,13 @@ static int ptp_populate_pins(struct ptp_clock *ptp) > struct ptp_clock_info *info = ptp->info; > int err = -ENOMEM, i, n_pins = info->n_pins; > > - ptp->pin_dev_attr = kzalloc(n_pins *

[PATCH 2/4] ptp: use kcalloc/kmallco_array when allocating arrays

2017-02-13 Thread Dmitry Torokhov
kcalloc/kmalloc_array are more semantically correct when allocating arrays of objects, and overflow-safe. Signed-off-by: Dmitry Torokhov --- drivers/ptp/ptp_sysfs.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/ptp/ptp_sysfs.c