9 Aug
2024
9 Aug
'24
4:36 p.m.
On Mon, Jun 24, 2024 at 11:42:11AM +0000, Ding, Shenghao wrote:
From: Andy Shevchenko andriy.shevchenko@linux.intel.com Sent: Wednesday, May 22, 2024 8:02 PM To: Ding, Shenghao shenghao-ding@ti.com On Wed, May 22, 2024 at 07: 29: 41PM +0800, Shenghao Ding wrote: >
(some comments were not answered, are you agree on all of the points?)
...
- cali_data->data = devm_kzalloc(tas_priv->dev, tas_priv->ndev *
(cali_data->reg_array_sz * 4 + 1), GFP_KERNEL);
No way. First of all, we have kcalloc(), second, there is an overflow.h that has necessary macros to calculate sizes for memory allocations.
Memory allocated with devm_kzalloc is automatically freed on driver detach while kcalloc can’t
Yes, we have devm variant for kcalloc(), why can it be not utilised?
- if (!cali_data->data)
return -ENOMEM;
--
With Best Regards,
Andy Shevchenko