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

Commit d83b852b authored by Yue Ma's avatar Yue Ma Committed by Gerrit - the friendly Code Review server
Browse files

cnss2: Add NULL check for pci_priv in dev_boot debug handling



If device is not ready, pci_priv will be NULL and be dereferenced in some
test cases using dev_boot debug node. Add NULL check to fix it.

Change-Id: I621d242ec7f34cf7b1eda9e067cf7b222f76eb31
Signed-off-by: default avatarYue Ma <yuem@codeaurora.org>
parent d77ce925
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -147,6 +147,8 @@ static ssize_t cnss_dev_boot_debug_write(struct file *fp,
		return -ENODEV;

	pci_priv = plat_priv->bus_priv;
	if (!pci_priv)
		return -ENODEV;

	len = min(count, sizeof(buf) - 1);
	if (copy_from_user(buf, user_buf, len))