Re: [PATCH v2 1/2] firmware: qcom: scm: fix a NULL-pointer dereference

From: Dmitry Baryshkov
Date: Wed Sep 11 2024 - 06:50:00 EST


On Wed, Sep 11, 2024 at 11:07:03AM GMT, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
>
> Some SCM calls can be invoked with __scm being NULL (the driver may not
> have been and will not be probed as there's no SCM entry in device-tree).
> Make sure we don't dereference a NULL pointer.
>
> Fixes: 449d0d84bcd8 ("firmware: qcom: scm: smc: switch to using the SCM allocator")
> Reported-by: Rudraksha Gupta <guptarud@xxxxxxxxx>
> Closes: https://lore.kernel.org/lkml/692cfe9a-8c05-4ce4-813e-82b3f310019a@xxxxxxxxx/
> Reviewed-by: Konrad Dybcio <konradybcio@xxxxxxxxxx>
> Tested-by: Rudraksha Gupta <guptarud@xxxxxxxxx>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
> ---
> drivers/firmware/qcom/qcom_scm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx>

--
With best wishes
Dmitry