ata,scsi: libata-core: Do not leak memory for ata_port struct members
libsas is currently not freeing all the struct ata_port struct members, e.g. ncq_sense_buf for a driver supporting Command Duration Limits (CDL). Add a function, ata_port_free(), that is used to free a ata_port, including its struct members. It makes sense to keep the code related to freeing a ata_port in its own function, which will also free all the struct members of struct ata_port. Fixes: 18bd7718 ("scsi: ata: libata: Handle completion of CDL commands using policy 0xD") Reviewed-by:John Garry <john.g.garry@oracle.com> Link: https://lore.kernel.org/r/20240629124210.181537-8-cassel@kernel.org Signed-off-by:
Niklas Cassel <cassel@kernel.org>
Showing
- drivers/ata/libata-core.c 14 additions, 10 deletionsdrivers/ata/libata-core.c
- drivers/scsi/libsas/sas_ata.c 3 additions, 3 deletionsdrivers/scsi/libsas/sas_ata.c
- drivers/scsi/libsas/sas_discover.c 1 addition, 1 deletiondrivers/scsi/libsas/sas_discover.c
- include/linux/libata.h 1 addition, 0 deletionsinclude/linux/libata.h
Please register or sign in to comment