diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2021-09-24 12:40:40 +0300 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2021-09-24 21:11:40 +0300 |
commit | ebe180d376a5f7b2e534b69d237aa6fab43008ee (patch) | |
tree | 51725111a74b2037c7884a5ecee9ab7baf1ec5ad /drivers/gpu/drm/gma500/psb_drv.c | |
parent | db6568498b35a4d5d5a99420df27ed25fae31406 (diff) | |
download | linux-ebe180d376a5f7b2e534b69d237aa6fab43008ee.tar.xz |
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 <yangyingliang@huawei.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: c2f17e60cbe1 ("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
Diffstat (limited to 'drivers/gpu/drm/gma500/psb_drv.c')
-rw-r--r-- | drivers/gpu/drm/gma500/psb_drv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c index 3d036d2a3b29..7a10bb39ef0b 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); |