]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
soc: qcom: smem: Avoid NULL pointer exception on remove
authorStephen Boyd <sboyd@codeaurora.org>
Fri, 28 Aug 2015 18:18:49 +0000 (11:18 -0700)
committerAndy Gross <agross@codeaurora.org>
Wed, 14 Oct 2015 19:51:20 +0000 (14:51 -0500)
Don't set a pointer to NULL and then dereference it in the next
line.

Cc: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Andy Gross <agross@codeaurora.org>
drivers/soc/qcom/smem.c

index 52365188a1c20288a754dc7e1a530e4b25570ac3..f402a606eb7dc8da1abbcf76ac2f8cd342e6146f 100644 (file)
@@ -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;
 }