linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/msm: Odd PTR_ERR usage
@ 2013-09-16 21:19 Thomas Meyer
  2013-09-18  0:08 ` Rob Clark
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Meyer @ 2013-09-16 21:19 UTC (permalink / raw)
  To: Linux Kernel Mailing List, airlied, dri-devel

The variable priv->kms is not initialized yet.

Found by "scripts/coccinelle/tests/odd_ptr_err.cocci".
PTR_ERR should access the value just tested by IS_ERR.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---

diff -u -p a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -199,7 +199,7 @@ static int msm_load(struct drm_device *d
 		 * imx drm driver on iMX5
 		 */
 		dev_err(dev->dev, "failed to load kms\n");
-		ret = PTR_ERR(priv->kms);
+		ret = PTR_ERR(kms);
 		goto fail;
 	}
 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/msm: Odd PTR_ERR usage
  2013-09-16 21:19 [PATCH] drm/msm: Odd PTR_ERR usage Thomas Meyer
@ 2013-09-18  0:08 ` Rob Clark
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Clark @ 2013-09-18  0:08 UTC (permalink / raw)
  To: Thomas Meyer; +Cc: Linux Kernel Mailing List, dri-devel, Dave Airlie

On Mon, Sep 16, 2013 at 5:19 PM, Thomas Meyer <thomas@m3y3r.de> wrote:
> The variable priv->kms is not initialized yet.
>
> Found by "scripts/coccinelle/tests/odd_ptr_err.cocci".
> PTR_ERR should access the value just tested by IS_ERR.
>
> Signed-off-by: Thomas Meyer <thomas@m3y3r.de>

thanks, I've got it queued up

BR,
-R

> ---
>
> diff -u -p a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -199,7 +199,7 @@ static int msm_load(struct drm_device *d
>                  * imx drm driver on iMX5
>                  */
>                 dev_err(dev->dev, "failed to load kms\n");
> -               ret = PTR_ERR(priv->kms);
> +               ret = PTR_ERR(kms);
>                 goto fail;
>         }
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-18  0:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-16 21:19 [PATCH] drm/msm: Odd PTR_ERR usage Thomas Meyer
2013-09-18  0:08 ` Rob Clark

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).