From: Dan Carpenter <dan.carpenter@oracle.com>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
Sagar Dharia <sdharia@codeaurora.org>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [PATCH 1/2] slimbus: qcom-ctrl: fix a NULL test
Date: Tue, 9 Jan 2018 12:26:16 +0300 [thread overview]
Message-ID: <20180109092616.mfha2rs56oaxfjaz@mwanda> (raw)
"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;
next reply other threads:[~2018-01-09 9:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-09 9:26 Dan Carpenter [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180109092616.mfha2rs56oaxfjaz@mwanda \
--to=dan.carpenter@oracle.com \
--cc=alsa-devel@alsa-project.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sdharia@codeaurora.org \
--cc=srinivas.kandagatla@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®