From: Suman Anna <s-anna@ti.com>
To: Henri Roosen <henri.roosen@ginzinger.com>,
<linux-remoteproc@vger.kernel.org>
Cc: Ohad Ben-Cohen <ohad@wizery.com>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] rpmsg: rpmsg_core: fix null-ptr dereference for devices without ops
Date: Fri, 2 Jun 2017 16:47:51 -0500 [thread overview]
Message-ID: <46048bd4-482d-37e8-9701-71754f72ffc2@ti.com> (raw)
In-Reply-To: <1496403321-32234-1-git-send-email-henri.roosen@ginzinger.com>
Hi Henri,
On 06/02/2017 06:35 AM, Henri Roosen wrote:
> A device might not have an ops structure registered. This
The rpmsg devices are registered from the respective backends, which are
supposed to plug in their ops. What is the scenario where you think
these ops might not be populated? We ought to check for NULL ops in
rpmsg_register_device in fact to make sure an ops pointer is supplied.
regards
Suman
> patch fixes a null-prt dereference by checking ops before dereferencing
> it.
>
> Signed-off-by: Henri Roosen <henri.roosen@ginzinger.com>
> ---
> drivers/rpmsg/rpmsg_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
> index 600f5f9..0c48452 100644
> --- a/drivers/rpmsg/rpmsg_core.c
> +++ b/drivers/rpmsg/rpmsg_core.c
> @@ -429,7 +429,7 @@ static int rpmsg_dev_probe(struct device *dev)
> goto out;
> }
>
> - if (rpdev->ops->announce_create)
> + if (rpdev->ops && rpdev->ops->announce_create)
> err = rpdev->ops->announce_create(rpdev);
> out:
> return err;
>
next prev parent reply other threads:[~2017-06-02 21:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-02 11:35 Henri Roosen
2017-06-02 21:47 ` Suman Anna [this message]
2017-06-25 21:51 ` Bjorn Andersson
2017-06-26 9:04 ` Henri Roosen
2017-06-28 19:24 ` Bjorn Andersson
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=46048bd4-482d-37e8-9701-71754f72ffc2@ti.com \
--to=s-anna@ti.com \
--cc=bjorn.andersson@linaro.org \
--cc=henri.roosen@ginzinger.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=ohad@wizery.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®