diff options
| author | Damien Le Moal <[email protected]> | 2024-09-23 09:06:46 +0000 |
|---|---|---|
| committer | Damien Le Moal <[email protected]> | 2024-09-24 07:56:21 +0000 |
| commit | 03a9cfc1314bf75cc7a83995f3a029a7ebf49c05 (patch) | |
| tree | 34c075f85bf2559d219a73af17e64e96f71c3e1b /drivers/fpga/zynq-fpga.c | |
| parent | ata: libata: Clear DID_TIME_OUT for ATA PT commands with sense data (diff) | |
| download | kernel-03a9cfc1314bf75cc7a83995f3a029a7ebf49c05.tar.gz kernel-03a9cfc1314bf75cc7a83995f3a029a7ebf49c05.zip | |
ata: libata-scsi: Fix ata_msense_control_spgt2()
ata_msense_control_spgt2() can be called even for devices that do not
support CDL when the user requests the ALL_SUB_MPAGES mode sense page,
but for such device, this will cause a NULL pointer dereference as
dev->cdl is NULL. Similarly, we should not return any data if
ata_msense_control_spgt2() is called when the user requested the
CDL_T2A_SUB_MPAGE or CDL_T2B_SUB_MPAGE pages for a device that does not
support CDL.
Avoid this potential NULL pointer dereference by checking if the device
support CDL on entry to ata_msense_control_spgt2() and return 0 if it
does not support CDL.
Reported-by: [email protected]
Tested-by: [email protected]
Fixes: 602bcf212637 ("ata: libata: Improve CDL resource management")
Signed-off-by: Damien Le Moal <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Diffstat (limited to 'drivers/fpga/zynq-fpga.c')
0 files changed, 0 insertions, 0 deletions
