Message ID | 20240930083328.17904-1-brgl@bgdev.pl |
---|---|
State | New |
Headers | show |
Series | [RESEND,v2] firmware: qcom: scm: fix a NULL-pointer dereference | expand |
On Mon, 30 Sep 2024 10:33:28 +0200, Bartosz Golaszewski wrote: > 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. > > Applied, thanks! [1/1] firmware: qcom: scm: fix a NULL-pointer dereference commit: ca61d6836e6f4442a77762e1074d2706a2a6e578 Best regards,
diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c index 10986cb11ec0..8bac4915c211 100644 --- a/drivers/firmware/qcom/qcom_scm.c +++ b/drivers/firmware/qcom/qcom_scm.c @@ -216,7 +216,7 @@ static DEFINE_SPINLOCK(scm_query_lock); struct qcom_tzmem_pool *qcom_scm_get_tzmem_pool(void) { - return __scm->mempool; + return __scm ? __scm->mempool : NULL; } static enum qcom_scm_convention __get_convention(void)