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

Commit 929c2ec9 authored by Maria Yu's avatar Maria Yu
Browse files

soc: qcom: check q6 data before using it in pil mss



Check q6 data if ERR or NULL before using it in
pil mss to avoid NULL pointer dereference.

Change-Id: I966f42b099effd0d0b97f87848152c8ae82a8a7c
Signed-off-by: default avatarMaria Yu <aiquny@codeaurora.org>
parent ccf21f85
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -209,7 +209,7 @@ static irqreturn_t modem_wdog_bite_intr_handler(int irq, void *dev_id)
static int pil_subsys_init(struct modem_data *drv,
					struct platform_device *pdev)
{
	int ret;
	int ret = -EINVAL;

	drv->subsys_desc.name = "modem";
	drv->subsys_desc.dev = &pdev->dev;
@@ -222,6 +222,13 @@ static int pil_subsys_init(struct modem_data *drv,
	drv->subsys_desc.stop_ack_handler = modem_stop_ack_intr_handler;
	drv->subsys_desc.wdog_bite_handler = modem_wdog_bite_intr_handler;

	if (IS_ERR_OR_NULL(drv->q6)) {
		ret = PTR_ERR(drv->q6);
		dev_err(&pdev->dev, "Pil q6 data is err %pK %d!!!\n",
			drv->q6, ret);
		goto err_subsys;
	}

	drv->q6->desc.modem_ssr = false;
	drv->q6->desc.signal_aop = of_property_read_bool(pdev->dev.of_node,
						"qcom,signal-aop");