mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] slimbus: qcom-ctrl: fix a NULL test
@ 2018-01-09  9:26 Dan Carpenter
  2018-01-09  9:26 ` [PATCH 2/2] slimbus: qcom-ctrl: Fix devm_ioremap_resource() error handling Dan Carpenter
  2018-01-09  9:48 ` [PATCH 1/2] slimbus: qcom-ctrl: fix a NULL test Srinivas Kandagatla
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2018-01-09  9:26 UTC (permalink / raw)
  To: Srinivas Kandagatla, Sagar Dharia
  Cc: alsa-devel, linux-kernel, kernel-janitors, Greg Kroah-Hartman

"retries" ends when it is set to -1 and not 0 so that part of the test
is wrong.  This bug would lead to a NULL dereference a couple lines
later.

Fixes: afbdcc7c384b ("slimbus: Add messaging APIs to slimbus framework")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Should Greg be added to the MAINTAINERS file for this driver?

diff --git a/drivers/slimbus/qcom-ctrl.c b/drivers/slimbus/qcom-ctrl.c
index fb1a5e0eb8dd..3ab59209cbdc 100644
--- a/drivers/slimbus/qcom-ctrl.c
+++ b/drivers/slimbus/qcom-ctrl.c
@@ -345,7 +345,7 @@ static int qcom_xfer_msg(struct slim_controller *sctrl,
 		}
 	}
 
-	if (!retries && !pbuf)
+	if (!pbuf)
 		return -ENOMEM;
 
 	puc = (u8 *)pbuf;

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

end of thread, other threads:[~2018-01-09  9:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-09  9:26 [PATCH 1/2] slimbus: qcom-ctrl: fix a NULL test Dan Carpenter
2018-01-09  9:26 ` [PATCH 2/2] slimbus: qcom-ctrl: Fix devm_ioremap_resource() error handling Dan Carpenter
2018-01-09  9:48   ` Srinivas Kandagatla
2018-01-09  9:48 ` [PATCH 1/2] slimbus: qcom-ctrl: fix a NULL test Srinivas Kandagatla

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®