linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vincent ABRIOU <vincent.abriou@st.com>
To: Arvind Yadav <arvind.yadav.cs@gmail.com>,
	"benjamin.gaignard@linaro.org" <benjamin.gaignard@linaro.org>,
	"airlied@linux.ie" <airlied@linux.ie>
Cc: "dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [v1] gpu: drm: sti: sti_vtg:- Handle return NULL error from devm_ioremap_nocache
Date: Wed, 4 Jan 2017 09:29:24 +0000	[thread overview]
Message-ID: <96f01b40-fb46-291b-7395-f95fef88be94@st.com> (raw)
In-Reply-To: <1482298212-4760-1-git-send-email-arvind.yadav.cs@gmail.com>

Thanks for the patch.

Acked-by: Vincent Abriou <vincent.abriou@st.com>

I will take it for pull request that should be issued by the end of the 
week.

Vincent

On 12/21/2016 06:30 AM, Arvind Yadav wrote:
> Here, If devm_ioremap_nocache will fail. It will return NULL.
> Kernel can run into a NULL-pointer dereference. This error check
> will avoid NULL pointer dereference.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
>  drivers/gpu/drm/sti/sti_vtg.c |    4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/sti/sti_vtg.c b/drivers/gpu/drm/sti/sti_vtg.c
> index a8882bd..c3d9c8a 100644
> --- a/drivers/gpu/drm/sti/sti_vtg.c
> +++ b/drivers/gpu/drm/sti/sti_vtg.c
> @@ -429,6 +429,10 @@ static int vtg_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  	}
>  	vtg->regs = devm_ioremap_nocache(dev, res->start, resource_size(res));
> +	if (!vtg->regs) {
> +		DRM_ERROR("failed to remap I/O memory\n");
> +		return -ENOMEM;
> +	}
>
>  	np = of_parse_phandle(pdev->dev.of_node, "st,slave", 0);
>  	if (np) {
>

      reply	other threads:[~2017-01-04 10:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-21  5:30 [v1] gpu: drm: sti: sti_vtg:- Handle return NULL error from devm_ioremap_nocache Arvind Yadav
2017-01-04  9:29 ` Vincent ABRIOU [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=96f01b40-fb46-291b-7395-f95fef88be94@st.com \
    --to=vincent.abriou@st.com \
    --cc=airlied@linux.ie \
    --cc=arvind.yadav.cs@gmail.com \
    --cc=benjamin.gaignard@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).