提交 21dba244 编写于 作者: T Tejun Heo 提交者: Jeff Garzik

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: NTejun Heo <tj@kernel.org>
Cc: Lei Ming <tom.leiming@gmail.com>
Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
上级 d8661921
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册