lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20190802012920.60344-1-weiyongjun1@huawei.com>
Date:   Fri, 2 Aug 2019 01:29:20 +0000
From:   Wei Yongjun <weiyongjun1@...wei.com>
To:     David Airlie <airlied@...ux.ie>, Daniel Vetter <daniel@...ll.ch>,
        "Rob Clark" <robdclark@...omium.org>,
        Thomas Zimmermann <tzimmermann@...e.de>,
        "Eric Biggers" <ebiggers@...gle.com>,
        Sam Ravnborg <sam@...nborg.org>,
        Sean Paul <seanpaul@...omium.org>
CC:     Wei Yongjun <weiyongjun1@...wei.com>,
        <dri-devel@...ts.freedesktop.org>, <linux-kernel@...r.kernel.org>,
        <kernel-janitors@...r.kernel.org>
Subject: [PATCH -next] drm/vgem: 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.

Fixes: 7e9e5ead55be ("drm/vgem: fix cache synchronization on arm/arm64")
Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>
---
 drivers/gpu/drm/vgem/vgem_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
index b98689fb0d5d..ef52546f48c4 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -304,10 +304,10 @@ static struct page **pin_and_sync(struct drm_vgem_gem_object *bo)
 	if (IS_ERR(sgt)) {
 		dev_err(dev->dev,
 			"failed to allocate sgt: %ld\n",
-			PTR_ERR(bo->table));
+			PTR_ERR(sgt));
 		drm_gem_put_pages(&bo->base, pages, false, false);
 		mutex_unlock(&bo->pages_lock);
-		return ERR_CAST(bo->table);
+		return ERR_CAST(sgt);
 	}
 
 	/*



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ