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

Commit 119d0502 authored by Saket Saurabh's avatar Saket Saurabh
Browse files

usb: ehci-msm: Fix potential NULL pointer dereference



Pointer returned from call to function kzalloc may be NULL.
Hence add NULL check to prevent NULL pointer dereference.

Change-Id: I4f4c8a7816c15e19c0231eb889bf00190b2ba262
Signed-off-by: default avatarSaket Saurabh <ssaurabh@codeaurora.org>
parent 1ec33670
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1036,6 +1036,8 @@ static ssize_t debug_read_phy_data(struct file *file, char __user *ubuf,
	int ret = 0;

	kbuf = kzalloc(sizeof(char) * BUF_SIZE, GFP_KERNEL);
	if (!kbuf)
		return -ENOMEM;
	pm_runtime_get(mhcd->dev);
	data = msm_ulpi_read(mhcd, addr);
	pm_runtime_put(mhcd->dev);