]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
libata: clear PIO pad area
authorTejun Heo <tj@kernel.org>
Tue, 6 Sep 2011 04:09:05 +0000 (13:09 +0900)
committerJeff Garzik <jgarzik@redhat.com>
Sat, 8 Oct 2011 03:46:25 +0000 (23:46 -0400)
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>
drivers/ata/libata-sff.c

index c24127dd6ef2d22051244429a8eeeec2679acd34..2487ea7a507aaf0320936152610075fd3ac631c6 100644 (file)
@@ -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;