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

Commit 8bbe4188 authored by Prakruthi Deepak Heragu's avatar Prakruthi Deepak Heragu Committed by Gerrit - the friendly Code Review server
Browse files

qcom_wdt_core: Validate the input parameters of qcom_wdt_register



Ensure that the input parameters of qcom_wdt_register is checked before
proceeding as this could cause NULL pointer dereferences.

Change-Id: I29e7eee946fb9fe0ba7fe75b96acedff7deab4bd
Signed-off-by: default avatarPrakruthi Deepak Heragu <pheragu@codeaurora.org>
parent 2c5e9303
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1003,6 +1003,11 @@ int qcom_wdt_register(struct platform_device *pdev,
	struct md_region md_entry;
	int ret;

	if (!pdev || !wdog_dd || !wdog_dd_name) {
		pr_err("wdt_register input incorrect\n");
		return -EINVAL;
	}

	qcom_wdt_dt_to_pdata(pdev, wdog_dd);
	wdog_data = wdog_dd;
	wdog_dd->dev = &pdev->dev;