soc: qcom: smem: Avoid NULL pointer exception on remove
Subsystems (2)
PATCH 1/1 soc: qcom: smem: Avoid NULL pointer exception on remove
Don't set a pointer to NULL and then dereference it in the next line.
Cc Bjorn Andersson <[email protected]>
Signed-off-by Stephen Boyd <[email protected]>
--- drivers/soc/qcom/smem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/qcom/smem.c +1 -1
@@ -737,8 +737,8 @@ static int qcom_smem_probe(struct platform_device *pdev)static int qcom_smem_remove (struct platform_device *pdev) { - __smem =NULL ;hwspin_lock_free (__smem->hwlock); + __smem =NULL ;return 0 ; }
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Quoted 3 lines · Stephen Boyd
Don't set a pointer to NULL and then dereference it in the next line.
Sorry about that.
Reviewed-by Bjorn Andersson <[email protected]>
Regards,
Bjorn