mirror of
https://github.com/torvalds/linux.git
synced 2026-05-13 00:28:54 +02:00
iio: adc: pac1934: Return -ENOMEM on memory allocation failure
devm_kzalloc() returns NULL on allocation failure. The appropriate error code for this condition is -ENOMEM, not -EINVAL. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
8e901c49ff
commit
25ac1dea21
|
|
@ -1351,7 +1351,7 @@ static int pac1934_prep_iio_channels(struct pac1934_chip_info *info, struct iio_
|
|||
|
||||
dyn_ch_struct = devm_kzalloc(dev, channel_size, GFP_KERNEL);
|
||||
if (!dyn_ch_struct)
|
||||
return -EINVAL;
|
||||
return -ENOMEM;
|
||||
|
||||
tmp_data = dyn_ch_struct;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user