kernel-hacking-2024-linux-s.../drivers/ata
Zheng Qixing 284b75a3d8 ata: libata: Fix memory leak for error path in ata_host_alloc()
In ata_host_alloc(), if devres_alloc() fails to allocate the device host
resource data pointer, the already allocated ata_host structure is not
freed before returning from the function. This results in a potential
memory leak.

Call kfree(host) before jumping to the error handling path to ensure
that the ata_host structure is properly freed if devres_alloc() fails.

Fixes: 2623c7a5f2 ("libata: add refcounting to ata_host")
Cc: stable@vger.kernel.org
Signed-off-by: Zheng Qixing <zhengqixing@huawei.com>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
2024-08-27 06:54:36 +09:00
..
pata_parport parport: Remove parport_driver.devmodel 2024-07-03 16:44:22 +02:00
acard-ahci.c
ahci.c ata: ahci: Add debug print for external port 2024-07-04 11:52:32 +02:00
ahci.h scsi: libata: Switch to using ->device_configure 2024-04-11 21:37:50 -04:00
ahci_brcm.c
ahci_ceva.c ata: ahci_ceva: fix error handling for Xilinx GT PHY support 2024-02-19 10:44:37 +01:00
ahci_da850.c
ahci_dm816.c
ahci_dwc.c
ahci_imx.c ata: imx: Use device_get_match_data() 2023-10-11 17:54:05 +09:00
ahci_mtk.c
ahci_mvebu.c
ahci_octeon.c
ahci_platform.c
ahci_qoriq.c
ahci_seattle.c
ahci_st.c ata: ahci_st: Remove an unused field in struct st_ahci_drv_data 2024-04-02 12:18:15 +09:00
ahci_sunxi.c
ahci_tegra.c
ahci_xgene.c ata: xgene: Use of_device_get_match_data() 2023-10-11 17:53:37 +09:00
ata_generic.c
ata_piix.c
Kconfig ata: Kconfig: Update SATA_MOBILE_LPM_POLICY default to med_power_with_dipm 2024-05-27 11:34:50 +02:00
libahci.c ata: libata-core: Set ATA_QCFLAG_RTF_FILLED in fill_result_tf() 2024-07-03 10:51:41 +02:00
libahci_platform.c
libata-acpi.c
libata-core.c ata: libata: Fix memory leak for error path in ata_host_alloc() 2024-08-27 06:54:36 +09:00
libata-eh.c scsi: sd: Fix TCG OPAL unlock on system resume 2024-03-25 15:46:12 -04:00
libata-pata-timings.c
libata-pmp.c
libata-sata.c ata,scsi: Remove wrapper ata_sas_port_alloc() 2024-07-04 11:52:32 +02:00
libata-scsi.c Revert "ata: libata-scsi: Honor the D_SENSE bit for CK_COND=1 and no error" 2024-08-14 15:49:37 +02:00
libata-sff.c ata: add HAS_IOPORT dependencies 2024-04-08 10:07:28 +09:00
libata-trace.c
libata-transport.c ata: libata-core: Remove local_port_no struct member 2024-07-04 11:52:32 +02:00
libata-transport.h ata,scsi: Remove wrappers ata_sas_tport_{add,delete}() 2024-07-04 11:52:31 +02:00
libata-zpodd.c
libata.h ata,scsi: Remove wrapper ata_sas_port_alloc() 2024-07-04 11:52:32 +02:00
Makefile
pata_acpi.c
pata_ali.c
pata_amd.c
pata_arasan_cf.c
pata_artop.c
pata_atiixp.c
pata_atp867x.c
pata_buddha.c
pata_cmd64x.c
pata_cmd640.c
pata_cs5520.c ata: pata_cs5520: Remove unnecessary call to pci_enable_device_io() 2024-05-16 14:35:08 -05:00
pata_cs5530.c
pata_cs5535.c
pata_cs5536.c
pata_cypress.c
pata_efar.c
pata_ep93xx.c
pata_falcon.c ata: pata_falcon: Convert to platform remove callback returning void 2023-11-08 09:00:44 +09:00
pata_ftide010.c
pata_gayle.c ata: pata_gayle: Convert to platform remove callback returning void 2023-11-08 09:00:49 +09:00
pata_hpt3x2n.c
pata_hpt3x3.c
pata_hpt37x.c
pata_hpt366.c
pata_icside.c
pata_imx.c
pata_isapnp.c ata: pata_isapnp: Add missing error check for devm_ioport_map() 2023-11-20 09:22:26 +09:00
pata_it821x.c
pata_it8213.c
pata_ixp4xx_cf.c
pata_jmicron.c
pata_legacy.c ata: pata_legacy: make legacy_exit() work again 2024-05-07 07:23:31 +09:00
pata_macio.c ata: pata_macio: Use WARN instead of BUG 2024-08-21 14:33:23 +09:00
pata_marvell.c
pata_mpc52xx.c
pata_mpiix.c
pata_netcell.c
pata_ninja32.c
pata_ns87410.c
pata_ns87415.c
pata_octeon_cf.c
pata_of_platform.c
pata_oldpiix.c
pata_opti.c
pata_optidma.c
pata_pcmcia.c
pata_pdc202xx_old.c
pata_pdc2027x.c
pata_piccolo.c
pata_platform.c
pata_pxa.c ata: pata_pxa: convert not to use dma_request_slave_channel() 2023-11-20 09:28:25 +09:00
pata_radisys.c
pata_rb532_cf.c
pata_rdc.c
pata_rz1000.c
pata_sc1200.c
pata_sch.c
pata_serverworks.c
pata_sil680.c
pata_sis.c
pata_sl82c105.c
pata_triflex.c
pata_via.c
pdc_adma.c
sata_dwc_460ex.c
sata_fsl.c
sata_gemini.c ata: sata_gemini: Check clk_enable() result 2024-04-04 12:42:00 +09:00
sata_gemini.h
sata_highbank.c
sata_inic162x.c
sata_mv.c SCSI misc on 20240514 2024-05-14 18:25:53 -07:00
sata_nv.c scsi: libata: Switch to using ->device_configure 2024-04-11 21:37:50 -04:00
sata_promise.c
sata_promise.h
sata_qstor.c
sata_rcar.c
sata_sil.c
sata_sil24.c scsi: libata: Switch to using ->device_configure 2024-04-11 21:37:50 -04:00
sata_sis.c
sata_svw.c
sata_sx4.c ata: sata_sx4: fix pdc20621_get_from_dimm() on 64-bit 2024-04-01 07:52:17 +09:00
sata_uli.c
sata_via.c
sata_vsc.c
sis.h