aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Yingliang <[email protected]>2021-09-24 17:40:40 +0800
committerThomas Zimmermann <[email protected]>2021-09-24 20:11:40 +0200
commitebe180d376a5f7b2e534b69d237aa6fab43008ee (patch)
tree51725111a74b2037c7884a5ecee9ab7baf1ec5ad
parentdb6568498b35a4d5d5a99420df27ed25fae31406 (diff)
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 <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Fixes: c2f17e60cbe1 ("drm/gma500: Embed struct drm_device in struct drm_psb_private") Reported-by: Hulk Robot <[email protected]> Cc: Thomas Zimmermann <[email protected]> Cc: Patrik Jakobsson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/gma500/psb_drv.c2
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);