mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Antoniu Miclaus <antoniu.miclaus@analog.com>
Cc: "Marius Cristea" <marius.cristea@microchip.com>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: pac1934: Return -ENOMEM on memory allocation failure
Date: Sat, 14 Feb 2026 19:34:52 +0000	[thread overview]
Message-ID: <20260214193452.6169704f@jic23-huawei> (raw)
In-Reply-To: <20260211171007.143527-1-antoniu.miclaus@analog.com>

On Wed, 11 Feb 2026 19:10:05 +0200
Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:

> devm_kzalloc() returns NULL on allocation failure. The appropriate error
> code for this condition is -ENOMEM, not -EINVAL.
> 
> Fixes: 0fb528c8255b ("iio: adc: adding support for PAC193x")

Given it's a small alloc and in practice those don't fail if you machine
is likely to boot and at worst you get a slightly misleading error code,
I don't think backports are appropriate, so I've applied this
dropping the fixes tag.


> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> ---
>  drivers/iio/adc/pac1934.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/pac1934.c b/drivers/iio/adc/pac1934.c
> index ec96bb0f2ed6..b791ce23f3fd 100644
> --- a/drivers/iio/adc/pac1934.c
> +++ b/drivers/iio/adc/pac1934.c
> @@ -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;
>  


      parent reply	other threads:[~2026-02-14 19:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-11 17:10 Antoniu Miclaus
2026-02-11 17:38 ` Andy Shevchenko
2026-02-14 19:34 ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260214193452.6169704f@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=antoniu.miclaus@analog.com \
    --cc=dlechner@baylibre.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marius.cristea@microchip.com \
    --cc=nuno.sa@analog.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®