On Fri May 9 14:08:56 2025 +0530, Dikshita Agarwal wrote:
> A warning reported by smatch indicated a possible null pointer
> dereference where one of the arguments to API
> "iris_hfi_gen2_handle_system_error" could sometimes be null.
> 
> To fix this, add a check to validate that the argument passed is not
> null before accessing its members.
> 
> Cc: [email protected]
> Fixes: fb583a214337 ("media: iris: introduce host firmware interface with 
> necessary hooks")
> Reported-by: Dan Carpenter <[email protected]>
> Closes: 
> https://lore.kernel.org/linux-media/[email protected]/
> Acked-by: Vikash Garodia <[email protected]>
> Reviewed-by: Bryan O'Donoghue <[email protected]>
> Tested-by: Neil Armstrong <[email protected]> # on SM8550-QRD
> Tested-by: Neil Armstrong <[email protected]> # on SM8550-HDK
> Tested-by: Neil Armstrong <[email protected]> # on SM8650-QRD
> Tested-by: Neil Armstrong <[email protected]> # on SM8650-HDK
> Signed-off-by: Dikshita Agarwal <[email protected]>
> Tested-by: Vikash Garodia <[email protected]> # on sa8775p-ride
> Signed-off-by: Bryan O'Donoghue <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>

Patch committed.

Thanks,
Hans Verkuil

 drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

---

diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c 
b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
index d1a2a497a7b2..4488540d1d41 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
@@ -265,7 +265,8 @@ static int iris_hfi_gen2_handle_system_error(struct 
iris_core *core,
 {
        struct iris_inst *instance;
 
-       dev_err(core->dev, "received system error of type %#x\n", pkt->type);
+       if (pkt)
+               dev_err(core->dev, "received system error of type %#x\n", 
pkt->type);
 
        core->state = IRIS_CORE_ERROR;
 

Reply via email to