linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] udmabuf: fix odd_ptr_err.cocci warnings
@ 2018-05-25 14:29 Julia Lawall
  0 siblings, 0 replies; only message in thread
From: Julia Lawall @ 2018-05-25 14:29 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: kbuild-all, linux-media, Sumit Semwal, dri-devel, linaro-mm-sig,
	linux-kernel

From: kbuild test robot <fengguang.wu@intel.com>

drivers/dma-buf/udmabuf.c:167:6-12: inconsistent IS_ERR and PTR_ERR on line 168.

 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: cc2d0e91bc15 ("udmabuf: driver update")
Signed-off-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: linux-kernel@vger.kernel.org
---

tree:   git://git.kraxel.org/linux udmabuf
head:   cc2d0e91bc15849baff695d175bfb8fba35f1465
commit: cc2d0e91bc15849baff695d175bfb8fba35f1465 [6/6] udmabuf: driver
update

 udmabuf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/dma-buf/udmabuf.c
+++ b/drivers/dma-buf/udmabuf.c
@@ -165,7 +165,7 @@ static long udmabuf_ioctl_create(struct
 		page = shmem_read_mapping_page(
 			file_inode(ubuf->filp)->i_mapping, pgoff + pgidx);
 		if (IS_ERR(page)) {
-			ret = PTR_ERR(buf);
+			ret = PTR_ERR(page);
 			goto err_put_pages;
 		}
 		ubuf->pages[pgidx] = page;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-05-25 14:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-25 14:29 [PATCH] udmabuf: fix odd_ptr_err.cocci warnings Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).