From: Michal Simek <michal.simek@amd.com>
To: Marco Pagani <marpagan@redhat.com>,
Anand Ashok Dumbre <anand.ashok.dumbre@xilinx.com>,
Jonathan Cameron <jic23@kernel.org>,
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>
Cc: 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: Wed, 30 Nov 2022 18:04:26 +0100 [thread overview]
Message-ID: <7127c7f4-89b3-31f8-cabc-43f955eded64@amd.com> (raw)
In-Reply-To: <20221125113112.219290-1-marpagan@redhat.com>
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>
Thanks,
Michal
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-11-30 17:06 UTC|newest]
Thread overview: 3+ 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-30 17:04 ` Michal Simek [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=7127c7f4-89b3-31f8-cabc-43f955eded64@amd.com \
--to=michal.simek@amd.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=anand.ashok.dumbre@xilinx.com \
--cc=jic23@kernel.org \
--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@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox