diff options
author | Hannes Reinecke <hare@suse.de> | 2016-04-04 11:43:57 +0200 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2016-04-04 18:07:40 +0200 |
commit | cffd1ee991c566bca937392cfacdafbe3b7b58c6 (patch) | |
tree | f4d01350ba01ddcadc90a3bb9508cd9880cc12f4 /drivers/ata/libata-scsi.c | |
parent | libata-scsi: sanitize ata_gen_ata_sense() (diff) | |
download | linux-cffd1ee991c566bca937392cfacdafbe3b7b58c6.tar.xz linux-cffd1ee991c566bca937392cfacdafbe3b7b58c6.zip |
libata: sanitize ata_tf_read_block()
Return U64_MAX if ata_tf_read_block() could not decode the LBA
address, and do not set the information sense descriptor in
ata_gen_ata_sense() in these cases.
tj: s/(u64)-1/U64_MAX/
Signed-off-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r-- | drivers/ata/libata-scsi.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index e331077ee446..fc23d3f4282d 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -1083,6 +1083,8 @@ static void ata_gen_ata_sense(struct ata_queued_cmd *qc) } block = ata_tf_read_block(&qc->result_tf, dev); + if (block == U64_MAX) + return; /* information sense data descriptor */ sb[7] = 12; |