Re: [PATCH v1] pinctrl: nomadik: Use kmemdup_array instead of kmemdup for multiple allocation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 21, 2024 at 02:49:58PM +0800, Yu Jiaoliang wrote:
> Let the kememdup_array() take care about multiplication and possible

kmemdup_array()

> overflows.

...

> +	dup_configs = kmemdup_array(configs, num_configs, sizeof(*dup_configs),
> +				    GFP_KERNEL);

I would even make this a single line.

...

> +	dup_configs = kmemdup_array(configs, num_configs, sizeof(*dup_configs),
> +				    GFP_KERNEL);


Ditto.

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux