[PATCH 2/4] HAB: guard against NULL imx_hab_ops in imx_hab_device_locked_down()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All other exported functions guard against imx_get_hab_ops() returning
NULL, before dereferencing the returned pointer. Do likewise in
imx_hab_device_locked_down().

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 drivers/hab/hab.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/hab/hab.c b/drivers/hab/hab.c
index 5bb97c4b689b..2a2d347dd68f 100644
--- a/drivers/hab/hab.c
+++ b/drivers/hab/hab.c
@@ -351,5 +351,8 @@ int imx_hab_device_locked_down(void)
 {
 	struct imx_hab_ops *ops = imx_get_hab_ops();
 
+	if (!ops)
+		return -ENOSYS;
+
 	return ops->device_locked_down();
 }
-- 
2.39.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux