]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
ata: Fix ZBC_OUT command block check
authorDamien Le Moal <damien.lemoal@wdc.com>
Tue, 26 Jun 2018 11:56:54 +0000 (20:56 +0900)
committerTejun Heo <tj@kernel.org>
Mon, 2 Jul 2018 15:59:11 +0000 (08:59 -0700)
commitb320a0a9f23c98f21631eb27bcbbca91c79b1c6e
tree825d8e21f42ebfb0710d38ac2485a4849627d504
parentba44579141f9e2c0229e6e7eeb00b5fa68f0f74a
ata: Fix ZBC_OUT command block check

The block (LBA) specified must not exceed the last addressable LBA,
which is dev->nr_sectors - 1. So fix the correct check is
"if (block >= dev->n_sectors)" and not "if (block > dev->n_sectords)".

Additionally, the asc/ascq to return for an LBA that is not a zone start
LBA should be ILLEGAL REQUEST, regardless if the bad LBA is out of
range.

Reported-by: David Butterfield <david.butterfield@wdc.com>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Cc: stable@vger.kernel.org
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/ata/libata-scsi.c