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 <[email protected]>
---
 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


Reply via email to