Re: [PATCH 5/6] driver core: Add __alloc_size hint to devm allocators

From: Andy Shevchenko
Date: Wed Feb 01 2023 - 13:41:46 EST


On Wed, Feb 01, 2023 at 12:11:41AM -0800, John Stultz wrote:
> On Tue, Jan 31, 2023 at 11:36 PM Yongqin Liu <yongqin.liu@xxxxxxxxxx> wrote:

...

> data->nr_sensors = 1;
> data->sensor = devm_kzalloc(dev, sizeof(*data->sensor) *
> data->nr_sensors, GFP_KERNEL);

Side note: This should use devm_kcalloc().

--
With Best Regards,
Andy Shevchenko