From: Dan Carpenter <dan.carpenter@oracle.com>
To: Chris Ball <cjb@laptop.org>
Cc: Jesper Juhl <jj@chaosbits.net>,
linux-mmc@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] mmc: ushc: fix an endianness conversion in ushc_request()
Date: Sun, 20 Nov 2011 21:06:05 +0000 [thread overview]
Message-ID: <20111120210605.GC7354@elgon.mountain> (raw)
The ->cmd_idx field is 8 bits, not 16 so the call to cpu_to_le16()
will probably set cmd_idx to zero here on big endian systems.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This is a static checker bug. Untested.
diff --git a/drivers/mmc/host/ushc.c b/drivers/mmc/host/ushc.c
index f08f944..8b7367a 100644
--- a/drivers/mmc/host/ushc.c
+++ b/drivers/mmc/host/ushc.c
@@ -278,7 +278,7 @@ static void ushc_request(struct mmc_host *mmc, struct mmc_request *req)
ushc->current_req = req;
/* Start cmd with CBW. */
- ushc->cbw->cmd_idx = cpu_to_le16(req->cmd->opcode);
+ ushc->cbw->cmd_idx = req->cmd->opcode;
if (req->data)
ushc->cbw->block_size = cpu_to_le16(req->data->blksz);
else
reply other threads:[~2011-11-20 21:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20111120210605.GC7354@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=cjb@laptop.org \
--cc=jj@chaosbits.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-mmc@vger.kernel.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