Parcourir la source

drm/msm: Odd PTR_ERR usage

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>
Thomas Meyer il y a 12 ans
Parent
commit
e4826a94c7
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      drivers/gpu/drm/msm/msm_drv.c

+ 1 - 1
drivers/gpu/drm/msm/msm_drv.c

@@ -199,7 +199,7 @@ static int msm_load(struct drm_device *dev, unsigned long flags)
 		 * 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;
 	}