ata: libata: add missing ata_identify_page_supported() calls
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>
Mon, 15 Nov 2021 03:47:26 +0000 (12:47 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Nov 2021 08:48:44 +0000 (09:48 +0100)
commite449d2e69ad7304a7ff1512e1e79bd1d881289cd
treeaceddb62a860cfb9df77d09472428dd79625c6ac
parent08a667e440d72864f0732c0084d1c1d370d28a84
ata: libata: add missing ata_identify_page_supported() calls

commit 06f6c4c6c3e8354dceddd77bd58f9a7a84c67246 upstream.

ata_dev_config_ncq_prio() and ata_dev_config_devslp() both access pages
of the IDENTIFY DEVICE data log. Before calling ata_read_log_page(),
make sure to check for the existence of the IDENTIFY DEVICE data log and
of the log page accessed using ata_identify_page_supported(). This
avoids useless error messages from ata_read_log_page() and failures with
some LLDD scsi drivers using libsas.

Reported-by: Nikolay <knv418@gmail.com>
Cc: stable@kernel.org # 5.15
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Tested-by: Matthew Perkowski <mgperkow@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/ata/libata-core.c