Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88fe3fc8 authored by Deepak Kumar's avatar Deepak Kumar Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Correct dma_buf_get function return value check



Check the return value of dma_buf_get function using
IS_ERR_OR_NULL as dma_buf_get function can return
ERR_PTR(-EINVAL) which won't be caught by simple NULL
check. This will avoid kernel panic due to invalid
pointer access.

Change-Id: I11ebf618edd25a251d3fb8bb7fbbb886e10d788f
Signed-off-by: default avatarDeepak Kumar <dkumar@codeaurora.org>
parent 4d292211
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2144,8 +2144,8 @@ static int kgsl_setup_dmabuf_useraddr(struct kgsl_device *device,
	}
	up_read(&current->mm->mmap_sem);

	if (dmabuf == NULL)
		return -ENODEV;
	if (IS_ERR_OR_NULL(dmabuf))
		return dmabuf ? PTR_ERR(dmabuf) : -ENODEV;

	ret = kgsl_setup_dma_buf(device, pagetable, entry, dmabuf);
	if (ret) {