mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] soc: qcom: socinfo: fix revision check in qcom_socinfo_probe()
@ 2024-10-16 14:48 Manikanta Mylavarapu
  2024-10-17 20:02 ` Konrad Dybcio
  2024-10-24 14:59 ` (subset) " Bjorn Andersson
  0 siblings, 2 replies; 3+ messages in thread
From: Manikanta Mylavarapu @ 2024-10-16 14:48 UTC (permalink / raw)
  To: andersson, konradybcio, hanchunchao, linux-arm-msm, linux-kernel
  Cc: quic_srichara, quic_varada

In success case, the revision holds a non-null pointer. The current
logic incorrectly returns an error for a non-null pointer, whereas
it should return an error for a null pointer.

The socinfo driver for IPQ9574 and IPQ5332 is currently broken,
resulting in the following error message
qcom-socinfo qcom-socinfo: probe with driver qcom-socinfo failed with
error -12

Add a null check for the revision to ensure it returns an error only in
failure case (null pointer).

Fixes: e694d2b5c58b ("soc: qcom: Add check devm_kasprintf() returned value")
Signed-off-by: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
---
 drivers/soc/qcom/socinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c
index 3c14df7a382c..ecfd3da9d5e8 100644
--- a/drivers/soc/qcom/socinfo.c
+++ b/drivers/soc/qcom/socinfo.c
@@ -786,7 +786,7 @@ static int qcom_socinfo_probe(struct platform_device *pdev)
 	qs->attr.revision = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%u.%u",
 					   SOCINFO_MAJOR(le32_to_cpu(info->ver)),
 					   SOCINFO_MINOR(le32_to_cpu(info->ver)));
-	if (!qs->attr.soc_id || qs->attr.revision)
+	if (!qs->attr.soc_id || !qs->attr.revision)
 		return -ENOMEM;
 
 	if (offsetof(struct socinfo, serial_num) <= item_size) {
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] soc: qcom: socinfo: fix revision check in qcom_socinfo_probe()
  2024-10-16 14:48 [PATCH 1/1] soc: qcom: socinfo: fix revision check in qcom_socinfo_probe() Manikanta Mylavarapu
@ 2024-10-17 20:02 ` Konrad Dybcio
  2024-10-24 14:59 ` (subset) " Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Konrad Dybcio @ 2024-10-17 20:02 UTC (permalink / raw)
  To: Manikanta Mylavarapu, andersson, konradybcio, hanchunchao,
	linux-arm-msm, linux-kernel
  Cc: quic_srichara, quic_varada

On 16.10.2024 4:48 PM, Manikanta Mylavarapu wrote:
> In success case, the revision holds a non-null pointer. The current
> logic incorrectly returns an error for a non-null pointer, whereas
> it should return an error for a null pointer.
> 
> The socinfo driver for IPQ9574 and IPQ5332 is currently broken,
> resulting in the following error message
> qcom-socinfo qcom-socinfo: probe with driver qcom-socinfo failed with
> error -12
> 
> Add a null check for the revision to ensure it returns an error only in
> failure case (null pointer).
> 
> Fixes: e694d2b5c58b ("soc: qcom: Add check devm_kasprintf() returned value")
> Signed-off-by: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: (subset) [PATCH 1/1] soc: qcom: socinfo: fix revision check in qcom_socinfo_probe()
  2024-10-16 14:48 [PATCH 1/1] soc: qcom: socinfo: fix revision check in qcom_socinfo_probe() Manikanta Mylavarapu
  2024-10-17 20:02 ` Konrad Dybcio
@ 2024-10-24 14:59 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2024-10-24 14:59 UTC (permalink / raw)
  To: konradybcio, hanchunchao, linux-arm-msm, linux-kernel,
	Manikanta Mylavarapu
  Cc: quic_srichara, quic_varada


On Wed, 16 Oct 2024 20:18:52 +0530, Manikanta Mylavarapu wrote:
> In success case, the revision holds a non-null pointer. The current
> logic incorrectly returns an error for a non-null pointer, whereas
> it should return an error for a null pointer.
> 
> The socinfo driver for IPQ9574 and IPQ5332 is currently broken,
> resulting in the following error message
> qcom-socinfo qcom-socinfo: probe with driver qcom-socinfo failed with
> error -12
> 
> [...]

Applied, thanks!

[1/1] soc: qcom: socinfo: fix revision check in qcom_socinfo_probe()
      commit: 128fdbf36cddc2a901c4889ba1c89fa9f2643f2c

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-24 14:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-16 14:48 [PATCH 1/1] soc: qcom: socinfo: fix revision check in qcom_socinfo_probe() Manikanta Mylavarapu
2024-10-17 20:02 ` Konrad Dybcio
2024-10-24 14:59 ` (subset) " Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®