From ebe180d376a5f7b2e534b69d237aa6fab43008ee Mon Sep 17 00:00:00 2001 From: Yang Yingliang Date: Fri, 24 Sep 2021 17:40:40 +0800 Subject: [PATCH] drm/gma500: Fix wrong pointer passed to PTR_ERR() PTR_ERR() should access the value just tested by IS_ERR(), otherwise the wrong error code will be returned. Signed-off-by: Yang Yingliang Signed-off-by: Thomas Zimmermann Reviewed-by: Thomas Zimmermann Fixes: c2f17e60cbe1 ("drm/gma500: Embed struct drm_device in struct drm_psb_private") Reported-by: Hulk Robot Cc: Thomas Zimmermann Cc: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20210924094040.3631675-1-yangyingliang@huawei.com --- drivers/gpu/drm/gma500/psb_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c index 3d036d2..7a10bb3 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c @@ -454,7 +454,7 @@ static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) dev_priv = devm_drm_dev_alloc(&pdev->dev, &driver, struct drm_psb_private, dev); if (IS_ERR(dev_priv)) - return PTR_ERR(dev); + return PTR_ERR(dev_priv); dev = &dev_priv->dev; pci_set_drvdata(pdev, dev); -- 2.7.4