From f8c67df71bcdd863d623985c9e8dc78368c862db Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Fri, 28 Aug 2015 11:18:49 -0700 Subject: [PATCH] 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 Signed-off-by: Stephen Boyd Reviewed-by: Bjorn Andersson Signed-off-by: Andy Gross --- drivers/soc/qcom/smem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c index 52365188a1c2..f402a606eb7d 100644 --- a/drivers/soc/qcom/smem.c +++ b/drivers/soc/qcom/smem.c @@ -730,8 +730,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; } -- 2.20.1