From: Dan Carpenter <dan.carpenter@oracle.com>
To: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [bug report] mtd: parsers: Add Qcom SMEM parser
Date: Fri, 8 Jan 2021 17:57:58 +0300 [thread overview]
Message-ID: <20210108145758.GD5105@kadam> (raw)
In-Reply-To: <20210108132828.GA28625@work>
On Fri, Jan 08, 2021 at 06:58:28PM +0530, Manivannan Sadhasivam wrote:
> Hi Dan,
>
> On Fri, Jan 08, 2021 at 03:52:41PM +0300, Dan Carpenter wrote:
> > Hello Manivannan Sadhasivam,
> >
> > The patch 803eb124e1a6: "mtd: parsers: Add Qcom SMEM parser" from Jan
> > 4, 2021, leads to the following static checker warning:
> >
> > drivers/mtd/parsers/qcomsmempart.c:109 parse_qcomsmem_part()
> > warn: passing zero to 'PTR_ERR'
> >
> > drivers/mtd/parsers/qcomsmempart.c
> > 68 pr_debug("Parsing partition table info from SMEM\n");
> > 69 ptable = qcom_smem_get(SMEM_APPS, SMEM_AARM_PARTITION_TABLE, &len);
> > 70 if (IS_ERR(ptable)) {
> >
> > Can "ptable" be NULL here?
> >
>
> No it won't. It will return valid error ptr in failure cases.
The Smatch warning is actually about the IS_ERR_OR_NULL() later. If it
returns NULL then that's counted as success. It's sometimes intentional
but here is seems like qcom_smem_get() never returns NULL so it could
be changed to just IS_ERR().
regards,
dan carpenter
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
prev parent reply other threads:[~2021-01-08 15:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-08 12:52 [bug report] mtd: parsers: Add Qcom SMEM parser Dan Carpenter
2021-01-08 13:28 ` Manivannan Sadhasivam
2021-01-08 14:57 ` Dan Carpenter [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=20210108145758.GD5105@kadam \
--to=dan.carpenter@oracle.com \
--cc=linux-mtd@lists.infradead.org \
--cc=manivannan.sadhasivam@linaro.org \
/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.