All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH #upstream-fixes] libata: clear PIO pad area
@ 2011-09-06  4:09 Tejun Heo
  2011-09-06 10:06 ` Sergei Shtylyov
  0 siblings, 1 reply; 7+ messages in thread
From: Tejun Heo @ 2011-09-06  4:09 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Alan Cox, linux-ide, tom.leiming

ata_sff_data_xfer[32]() use pad area if the transfer size isn't
multiple of transfer size; however, this area wasn't cleared and
garbage data in pad area could be transferred to the device.  Make
sure the pad area is cleared.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Lei Ming <tom.leiming@gmail.com>
---
 drivers/ata/libata-sff.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index c24127d..2487ea7 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -569,7 +569,7 @@ unsigned int ata_sff_data_xfer(struct ata_device *dev, unsigned char *buf,
 
 	/* Transfer trailing byte, if any. */
 	if (unlikely(buflen & 0x01)) {
-		unsigned char pad[2];
+		unsigned char pad[2] = { };
 
 		/* Point buf to the tail of buffer */
 		buf += buflen - 1;
@@ -628,7 +628,7 @@ unsigned int ata_sff_data_xfer32(struct ata_device *dev, unsigned char *buf,
 
 	/* Transfer trailing bytes, if any */
 	if (unlikely(slop)) {
-		unsigned char pad[4];
+		unsigned char pad[4] = { };
 
 		/* Point buf to the tail of buffer */
 		buf += buflen - slop;

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

end of thread, other threads:[~2011-09-06 17:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-06  4:09 [PATCH #upstream-fixes] libata: clear PIO pad area Tejun Heo
2011-09-06 10:06 ` Sergei Shtylyov
2011-09-06 11:16   ` Alan Cox
2011-09-06 16:58   ` Tejun Heo
2011-09-06 17:23     ` Sergei Shtylyov
2011-09-06 17:28       ` Sergei Shtylyov
2011-09-06 17:30       ` Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.