From: Arnd Bergmann <arnd@arndb.de>
To: Lars-Peter Clausen <lars@metafoo.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Ksenija Stanojevic <ksenija.stanojevic@gmail.com>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Jonathan Cameron <jic23@kernel.org>,
Hartmut Knaack <knaack.h@gmx.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Ioana Ciornei <ciorneiioana@gmail.com>,
Daniel Baluta <daniel.baluta@intel.com>,
linux-iio@vger.kernel.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] staging: iio: fix ad7606_spi regression
Date: Mon, 30 May 2016 15:50:24 +0200 [thread overview]
Message-ID: <1464616249-3523805-1-git-send-email-arnd@arndb.de> (raw)
As pointed out by Geert Uytterhoeven, the patch was incorrect
and breaks the driver, which was fortunately pointed out by
this gcc warning:
drivers/staging/iio/adc/ad7606_spi.c: In function ‘ad7606_spi_read_block’:
drivers/staging/iio/adc/ad7606_spi.c:34: warning: ‘data’ is used uninitialized in this function
The effect of the patch is that the data is copied into
a random memory location (from the uninitialized pointer)
instead of being byteswapped in place.
This adds the initialization for the 'data' variable back
to restore the original behavior.
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Fixes: 87787e5ef727 ("Staging: iio: Fix sparse endian warning")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/staging/iio/adc/ad7606_spi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/iio/adc/ad7606_spi.c b/drivers/staging/iio/adc/ad7606_spi.c
index 825da0769936..9587fa86dc69 100644
--- a/drivers/staging/iio/adc/ad7606_spi.c
+++ b/drivers/staging/iio/adc/ad7606_spi.c
@@ -21,7 +21,7 @@ static int ad7606_spi_read_block(struct device *dev,
{
struct spi_device *spi = to_spi_device(dev);
int i, ret;
- unsigned short *data;
+ unsigned short *data = buf;
__be16 *bdata = buf;
ret = spi_read(spi, buf, count * 2);
--
2.7.0
next reply other threads:[~2016-05-30 13:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-30 13:50 Arnd Bergmann [this message]
2016-05-30 13:54 ` Geert Uytterhoeven
2016-06-11 16:58 ` Jonathan Cameron
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=1464616249-3523805-1-git-send-email-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=Michael.Hennerich@analog.com \
--cc=ciorneiioana@gmail.com \
--cc=daniel.baluta@intel.com \
--cc=devel@driverdev.osuosl.org \
--cc=geert@linux-m68k.org \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=ksenija.stanojevic@gmail.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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®