summaryrefslogtreecommitdiff
path: root/drivers/ata
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-09-06 08:09:05 +0400
committerJeff Garzik <jgarzik@redhat.com>2011-10-08 07:46:25 +0400
commit21dba24481f70696308bd4361a7b2460c8a41965 (patch)
tree6048c5cc4abbe94282474587d6f0c418cb36951f /drivers/ata
parentd86619211ed3cdf4f6abff984774b65314aba0fe (diff)
downloadlinux-21dba24481f70696308bd4361a7b2460c8a41965.tar.xz
libata: clear PIO pad area
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> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-sff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index c24127dd6ef2..2487ea7a507a 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;