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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 28 Nov 2017 13:56:24 +0100 (CET)
From:   Julia Lawall <julia.lawall@...6.fr>
To:     Ben Skeggs <bskeggs@...hat.com>
cc:     David Airlie <airlied@...ux.ie>, dri-devel@...ts.freedesktop.org,
        nouveau@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
        linux-kernel@...r.kernel.org, kbuild-all@...org
Subject: [PATCH] drm/nouveau/mmu: fix odd_ptr_err.cocci warnings (fwd)

This is a false positive, but I wonder if it is really necessary to put
the assignment in the conditional test expression.

julia

---------- Forwarded message ----------
Date: Tue, 28 Nov 2017 13:23:36 +0800
From: kbuild test robot <fengguang.wu@...el.com>
To: kbuild@...org
Cc: Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH] drm/nouveau/mmu: fix odd_ptr_err.cocci warnings

CC: kbuild-all@...org
CC: linux-kernel@...r.kernel.org
TO: Ben Skeggs <bskeggs@...hat.com>
CC: David Airlie <airlied@...ux.ie>
CC: dri-devel@...ts.freedesktop.org
CC: nouveau@...ts.freedesktop.org
CC: linux-kernel@...r.kernel.org

drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c:109:5-11: inconsistent IS_ERR and PTR_ERR on line 110.
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c:109:5-11: inconsistent IS_ERR and PTR_ERR on line 111.

 PTR_ERR should access the value just tested by IS_ERR

Semantic patch information:
 There can be false positives in the patch case, where it is the call to
 IS_ERR that is wrong.

Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci

Fixes: 920d2b5ef215 ("drm/nouveau/mmu: define user interfaces to mmu vmm opertaions")
Signed-off-by: Fengguang Wu <fengguang.wu@...el.com>
---

Please take the patch only if it's a positive warning. Thanks!

 uvmm.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c
@@ -107,8 +107,9 @@ nvkm_uvmm_mthd_map(struct nvkm_uvmm *uvm
 		return ret;

 	if (IS_ERR((memory = nvkm_umem_search(client, handle)))) {
-		VMM_DEBUG(vmm, "memory %016llx %ld\n", handle, PTR_ERR(memory));
-		return PTR_ERR(memory);
+		VMM_DEBUG(vmm, "memory %016llx %ld\n", handle,
+			  PTR_ERR((memory = nvkm_umem_search(client, handle))));
+		return PTR_ERR((memory = nvkm_umem_search(client, handle)));
 	}

 	mutex_lock(&vmm->mutex);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ