All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Michal Simek <michal.simek@amd.com>
Cc: Marco Pagani <marpagan@redhat.com>,
	Anand Ashok Dumbre <anand.ashok.dumbre@xilinx.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Michal Simek <michal.simek@xilinx.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Tom Rix <trix@redhat.com>,
	Manish Narani <manish.narani@xilinx.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	<linux-iio@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <llvm@lists.linux.dev>
Subject: Re: [PATCH] iio: adc: xilinx-ams: fix devm_krealloc() return value check
Date: Sun, 4 Dec 2022 14:36:13 +0000	[thread overview]
Message-ID: <20221204143613.310ed016@jic23-huawei> (raw)
In-Reply-To: <7127c7f4-89b3-31f8-cabc-43f955eded64@amd.com>

On Wed, 30 Nov 2022 18:04:26 +0100
Michal Simek <michal.simek@amd.com> wrote:

> On 11/25/22 12:31, Marco Pagani wrote:
> > CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
> > 
> > 
> > The clang-analyzer reported a warning: "Value stored to 'ret'
> > is never read".
> > 
> > Fix the return value check if devm_krealloc() fails to resize
> > ams_channels.
> > 
> > Fixes: d5c70627a794 ("iio: adc: Add Xilinx AMS driver")
> > Signed-off-by: Marco Pagani <marpagan@redhat.com>
> > ---
> >   drivers/iio/adc/xilinx-ams.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/iio/adc/xilinx-ams.c b/drivers/iio/adc/xilinx-ams.c
> > index 5b4bdf3a26bb..a507d2e17079 100644
> > --- a/drivers/iio/adc/xilinx-ams.c
> > +++ b/drivers/iio/adc/xilinx-ams.c
> > @@ -1329,7 +1329,7 @@ static int ams_parse_firmware(struct iio_dev *indio_dev)
> > 
> >          dev_channels = devm_krealloc(dev, ams_channels, dev_size, GFP_KERNEL);
> >          if (!dev_channels)
> > -               ret = -ENOMEM;
> > +               return -ENOMEM;
> > 
> >          indio_dev->channels = dev_channels;
> >          indio_dev->num_channels = num_channels;
> > --
> > 2.38.1
> >   
> 
> Acked-by: Michal Simek <michal.simek@amd.com>

Applied to the fixes-togreg branch of iio.git.  Given merge window opening soon
it might be a few weeks before this goes upstream.

Thanks,

Jonathan

> 
> Thanks,
> Michal


WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <jic23@kernel.org>
To: Michal Simek <michal.simek@amd.com>
Cc: Marco Pagani <marpagan@redhat.com>,
	Anand Ashok Dumbre <anand.ashok.dumbre@xilinx.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Michal Simek <michal.simek@xilinx.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Tom Rix <trix@redhat.com>,
	Manish Narani <manish.narani@xilinx.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	<linux-iio@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <llvm@lists.linux.dev>
Subject: Re: [PATCH] iio: adc: xilinx-ams: fix devm_krealloc() return value check
Date: Sun, 4 Dec 2022 14:36:13 +0000	[thread overview]
Message-ID: <20221204143613.310ed016@jic23-huawei> (raw)
In-Reply-To: <7127c7f4-89b3-31f8-cabc-43f955eded64@amd.com>

On Wed, 30 Nov 2022 18:04:26 +0100
Michal Simek <michal.simek@amd.com> wrote:

> On 11/25/22 12:31, Marco Pagani wrote:
> > CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
> > 
> > 
> > The clang-analyzer reported a warning: "Value stored to 'ret'
> > is never read".
> > 
> > Fix the return value check if devm_krealloc() fails to resize
> > ams_channels.
> > 
> > Fixes: d5c70627a794 ("iio: adc: Add Xilinx AMS driver")
> > Signed-off-by: Marco Pagani <marpagan@redhat.com>
> > ---
> >   drivers/iio/adc/xilinx-ams.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/iio/adc/xilinx-ams.c b/drivers/iio/adc/xilinx-ams.c
> > index 5b4bdf3a26bb..a507d2e17079 100644
> > --- a/drivers/iio/adc/xilinx-ams.c
> > +++ b/drivers/iio/adc/xilinx-ams.c
> > @@ -1329,7 +1329,7 @@ static int ams_parse_firmware(struct iio_dev *indio_dev)
> > 
> >          dev_channels = devm_krealloc(dev, ams_channels, dev_size, GFP_KERNEL);
> >          if (!dev_channels)
> > -               ret = -ENOMEM;
> > +               return -ENOMEM;
> > 
> >          indio_dev->channels = dev_channels;
> >          indio_dev->num_channels = num_channels;
> > --
> > 2.38.1
> >   
> 
> Acked-by: Michal Simek <michal.simek@amd.com>

Applied to the fixes-togreg branch of iio.git.  Given merge window opening soon
it might be a few weeks before this goes upstream.

Thanks,

Jonathan

> 
> Thanks,
> Michal


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-12-04 14:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25 11:31 [PATCH] iio: adc: xilinx-ams: fix devm_krealloc() return value check Marco Pagani
2022-11-25 11:31 ` Marco Pagani
2022-11-30 17:04 ` Michal Simek
2022-11-30 17:04   ` Michal Simek
2022-12-04 14:36   ` Jonathan Cameron [this message]
2022-12-04 14:36     ` Jonathan Cameron

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=20221204143613.310ed016@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=anand.ashok.dumbre@xilinx.com \
    --cc=lars@metafoo.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=manish.narani@xilinx.com \
    --cc=marpagan@redhat.com \
    --cc=michal.simek@amd.com \
    --cc=michal.simek@xilinx.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=trix@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.