Skip to content

Commit

Permalink
drm/msm: Odd PTR_ERR usage
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Meyer authored and Rob Clark committed Sep 28, 2013
1 parent d8524ae commit e4826a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/msm/msm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e4826a9

Please sign in to comment.