提交 01392347 编写于 作者: D Dan Carpenter 提交者: Damien Le Moal

pata_legacy: fix a couple uninitialized variable bugs

The last byte of "pad" is used without being initialized.

Fixes: 55dba312 ("libata: update ->data_xfer hook for ATAPI")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NDamien Le Moal <damien.lemoal@wdc.com>
上级 64570fbc
......@@ -352,7 +352,8 @@ static unsigned int pdc_data_xfer_vlb(struct ata_queued_cmd *qc,
iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
if (unlikely(slop)) {
__le32 pad;
__le32 pad = 0;
if (rw == READ) {
pad = cpu_to_le32(ioread32(ap->ioaddr.data_addr));
memcpy(buf + buflen - slop, &pad, slop);
......@@ -742,7 +743,8 @@ static unsigned int vlb32_data_xfer(struct ata_queued_cmd *qc,
ioread32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
if (unlikely(slop)) {
__le32 pad;
__le32 pad = 0;
if (rw == WRITE) {
memcpy(&pad, buf + buflen - slop, slop);
iowrite32(le32_to_cpu(pad), ap->ioaddr.data_addr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册