Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1215501

[PATCH] soc: qcom: smem: Avoid NULL pointer exception on remove

From Stephen Boyd <sboyd@codeaurora.org>
Newsgroups linux.kernel
Subject [PATCH] soc: qcom: smem: Avoid NULL pointer exception on remove
Date 2015-08-28 20:20 +0200
Message-ID <q2wpQ-2E1-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 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 6603201d7fc7..4c347e7c5880 100644
--- a/drivers/soc/qcom/smem.c
+++ b/drivers/soc/qcom/smem.c
@@ -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;
 }
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] soc: qcom: smem: Avoid NULL pointer exception on remove Stephen Boyd <sboyd@codeaurora.org> - 2015-08-28 20:20 +0200
  Re: [PATCH] soc: qcom: smem: Avoid NULL pointer exception on remove Bjorn Andersson <bjorn.andersson@sonymobile.com> - 2015-08-29 00:40 +0200

csiph-web