From: Steven Price <steven.price@arm.com>
To: Kangjie Lu <kjlu@umn.edu>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, pakki001@umn.edu
Subject: Re: [PATCH] firmware: arm_scmi: check return value of idr_find
Date: Tue, 26 Mar 2019 11:34:42 +0000 [thread overview]
Message-ID: <94d8e411-1eef-1450-4828-5faabb03a3d1@arm.com> (raw)
In-Reply-To: <20190325204823.5428-1-kjlu@umn.edu>
On 25/03/2019 20:48, Kangjie Lu wrote:
> Thanks for Steven Price's review of this patch. In the current code,
There's no need to include a "thanks" message in the commit message -
the "Reviewed-by" tag is sufficient. Please also remember to include an
appropriate version tag in the subject - this should be "v2".
Thanks,
Steve
> idr_find won't return NULL because the SCMI_PROTOCOL_BASE id must
> exist. However, it might return NULL in the future code if the check
> is on another node while processing the children in subsequent calls
> to scmi_mbox_chan_setup().
> Therefore, the patch conservatively checks the return value and
> returns -EINVAL when it indeed failed.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
> Reviewed-by: Steven Price <steven.price@arm.com>
> ---
> drivers/firmware/arm_scmi/driver.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> index 8f952f2f1a29..35faa203d549 100644
> --- a/drivers/firmware/arm_scmi/driver.c
> +++ b/drivers/firmware/arm_scmi/driver.c
> @@ -709,6 +709,8 @@ scmi_mbox_chan_setup(struct scmi_info *info, struct device *dev, int prot_id)
>
> if (scmi_mailbox_check(np)) {
> cinfo = idr_find(&info->tx_idr, SCMI_PROTOCOL_BASE);
> + if (!cinfo)
> + return -EINVAL;
> goto idr_alloc;
> }
>
>
next prev parent reply other threads:[~2019-03-26 11:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-09 4:02 Kangjie Lu
2019-03-23 2:18 ` Kangjie Lu
2019-03-25 11:54 ` Steven Price
2019-03-25 20:48 ` Kangjie Lu
2019-03-26 11:34 ` Steven Price [this message]
2019-04-10 16:31 ` Sudeep Holla
2019-04-10 16:25 ` Sudeep Holla
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=94d8e411-1eef-1450-4828-5faabb03a3d1@arm.com \
--to=steven.price@arm.com \
--cc=kjlu@umn.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pakki001@umn.edu \
--cc=sudeep.holla@arm.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®