linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: inki.dae@samsung.com (Inki Dae)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] drm/exynos: Avoid NULL pointer dereference in resume if bind failed
Date: Wed, 30 Sep 2015 20:26:37 +0900	[thread overview]
Message-ID: <560BC6ED.3090205@samsung.com> (raw)
In-Reply-To: <1443370306-15429-1-git-send-email-ckeepax@opensource.wolfsonmicro.com>

Hi,

On 2015? 09? 28? 01:11, Charles Keepax wrote:
> If binding failed calling exynos_dp_enable in exynos_dp_resume will
> result in several NULL pointer dereferences. It is much better to
> simply skip suspend/resume handling if bind has failed, do so by
> checking if a drm_dev exists.

Thanks for your patch. However, the pm interfaces of KMS drivers aren't
required because these are controlled by top of Exynos drm driver and
connector dpms. So I posted a patch that it removes pm interfaces of dp
driver.

Thanks,
Inki Dae

> 
> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> ---
>  drivers/gpu/drm/exynos/exynos_dp_core.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c b/drivers/gpu/drm/exynos/exynos_dp_core.c
> index d66ade0..48baf07 100644
> --- a/drivers/gpu/drm/exynos/exynos_dp_core.c
> +++ b/drivers/gpu/drm/exynos/exynos_dp_core.c
> @@ -1388,6 +1388,9 @@ static int exynos_dp_suspend(struct device *dev)
>  {
>  	struct exynos_dp_device *dp = dev_get_drvdata(dev);
>  
> +	if (!dp->drm_dev)
> +		return 0;
> +
>  	exynos_dp_disable(&dp->encoder);
>  	return 0;
>  }
> @@ -1396,6 +1399,9 @@ static int exynos_dp_resume(struct device *dev)
>  {
>  	struct exynos_dp_device *dp = dev_get_drvdata(dev);
>  
> +	if (!dp->drm_dev)
> +		return 0;
> +
>  	exynos_dp_enable(&dp->encoder);
>  	return 0;
>  }
> 

  reply	other threads:[~2015-09-30 11:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-27 16:11 [PATCH] drm/exynos: Avoid NULL pointer dereference in resume if bind failed Charles Keepax
2015-09-30 11:26 ` Inki Dae [this message]
2015-09-30 13:15   ` Charles Keepax

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=560BC6ED.3090205@samsung.com \
    --to=inki.dae@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.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).