[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <77485a55-c9da-408f-8dcc-77c6734927da@linaro.org>
Date: Sat, 2 Mar 2024 00:42:26 +0100
From: Konrad Dybcio <konrad.dybcio@...aro.org>
To: Mukesh Ojha <quic_mojha@...cinc.com>, andersson@...nel.org
Cc: linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
linus.walleij@...aro.org, linux-gpio@...r.kernel.org
Subject: Re: [PATCH v12 8/9] firmware: qcom: scm: Add check to prevent Null
pointer dereference
On 27.02.2024 16:53, Mukesh Ojha wrote:
> There are multiple place in SCM driver __scm->dev is being
> accessed without checking if it is valid or not and all
> not all of function needs the device but it is needed
> for some cases when the number of argument passed is more
> and dma_map_single () api is used.
>
> Add a NULL check for the cases when it is fine even to pass
> device as NULL and add qcom_scm_is_available() check for
> cases when it is needed for DMA api's.
>
> Signed-off-by: Mukesh Ojha <quic_mojha@...cinc.com>
> ---
Most (all?) drivers calling into SCM already check is_available()
at probe time. I'm not sure returning -EPROBE_DEFER would be good
for calls outside .probe.
Konrad
Powered by blists - more mailing lists