Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <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>

authored by

Stephen Boyd and committed by
Andy Gross
f8c67df7 1a7caca2

+1 -1
+1 -1
drivers/soc/qcom/smem.c
··· 730 730 731 731 static int qcom_smem_remove(struct platform_device *pdev) 732 732 { 733 - __smem = NULL; 734 733 hwspin_lock_free(__smem->hwlock); 734 + __smem = NULL; 735 735 736 736 return 0; 737 737 }