]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/gma500: Fix wrong pointer passed to PTR_ERR()
authorYang Yingliang <yangyingliang@huawei.com>
Fri, 24 Sep 2021 09:40:40 +0000 (17:40 +0800)
committerThomas Zimmermann <tzimmermann@suse.de>
Fri, 24 Sep 2021 18:11:40 +0000 (20:11 +0200)
PTR_ERR() should access the value just tested by IS_ERR(),
otherwise the wrong error code will be returned.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 98b74fdaa450 ("drm/gma500: Embed struct drm_device in struct drm_psb_private")
Reported-by: Hulk Robot <hulkci@huawei.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210924094040.3631675-1-yangyingliang@huawei.com
drivers/gpu/drm/gma500/psb_drv.c

index 3d036d2a3b299ef0381c2aa318655d9efdcdf6d1..7a10bb39ef0b7ce4dca2d095e706b913e5daee2a 100644 (file)
@@ -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);