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

Commit 9d6c6b76 authored by jiangjia's avatar jiangjia Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: pil: Add the assert in subsys_set_error



If one subsystem not initlize its subsys_dev, it will access
invalid pointer in subsys_set_error.

Change-Id: Ied2031bf2e54c24f8ff0fe0eeb2ce3c2217a86ad
Signed-off-by: default avatarJiangjiang Shen <jiangjia@codeaurora.org>
parent 271134ac
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1190,9 +1190,12 @@ bool subsys_get_crash_status(struct subsys_device *dev)

void subsys_set_error(struct subsys_device *dev, const char *error_msg)
{
	snprintf(dev->error_buf, sizeof(dev->error_buf), "%s", error_msg);
	if (dev) {
		snprintf(dev->error_buf, sizeof(dev->error_buf), "%s",
							   error_msg);
		sysfs_notify(&dev->dev.kobj, NULL, "error");
	}
}

static struct subsys_device *desc_to_subsys(struct device *d)
{