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

Commit 0672e7c1 authored by Girish Mahadevan's avatar Girish Mahadevan
Browse files

msm: msm_bus: Move debug statement to avoid NULL dereference



Move debug statements to after the buffer sanity checks to avoid NULL
pointer derefernces.

Change-Id: I40f12c6b40fb6829f4f372cd20c68f9536f2e2ad
Signed-off-by: default avatarGirish Mahadevan <girishm@codeaurora.org>
parent 57301a09
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -250,14 +250,14 @@ msm_buspm_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
		break;

	case MSM_BUSPM_IOC_RDBUF:
		pr_debug("Read Buffer: 0x%x%x%x%x\n",
				dbgbuf[0], dbgbuf[1], dbgbuf[2], dbgbuf[3]);

		if (!buf) {
			retval = -EINVAL;
			break;
		}

		pr_debug("Read Buffer: 0x%x%x%x%x\n",
				dbgbuf[0], dbgbuf[1], dbgbuf[2], dbgbuf[3]);

		if (copy_from_user(&xfer, (void __user *)arg, sizeof(xfer))) {
			retval = -EFAULT;
			break;