WSL2-Linux-Kernel/drivers/ata
Ondrej Zary 5bc9e2d43f ata: pata_parport: fix memory leaks
When ida_alloc() fails, "pi" is not freed although the misleading
comment says otherwise.
Move the ida_alloc() call up so we really don't have to free "pi" in
case of ida_alloc() failure.

Also move ida_free() call from pi_remove_one() to
pata_parport_dev_release(). It was dereferencing already freed dev
pointer.

Testing revealed leak even in non-failure case which was tracked down
to missing put_device() call after bus_find_device_by_name(). As a
result, pata_parport_dev_release() was never called.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/202303111822.IHNchbkp-lkp@intel.com/
Signed-off-by: Ondrej Zary <linux@zary.sk>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2023-03-16 16:54:38 +09:00
..
pata_parport ata: pata_parport: fix memory leaks 2023-03-16 16:54:38 +09:00
Kconfig ATA changes for 6.3-rc1 2023-02-22 13:35:51 -08:00
Makefile ATA changes for 6.3-rc1 2023-02-22 13:35:51 -08:00
acard-ahci.c ata: libata: simplify qc_fill_rtf port operation interface 2023-01-04 13:37:45 +09:00
ahci.c ata: ahci: Revert "ata: ahci: Add Tiger Lake UP{3,4} AHCI controller" 2023-03-03 18:43:02 +09:00
ahci.h ata changes for 6.2 2022-12-13 10:54:19 -08:00
ahci_brcm.c ata: ahci_brcm: Fix compilation warning 2022-10-18 08:01:57 +09:00
ahci_ceva.c
ahci_da850.c ata: libahci_platform: Convert to using devm bulk clocks API 2022-09-17 01:39:22 +09:00
ahci_dm816.c ata: libahci_platform: Convert to using devm bulk clocks API 2022-09-17 01:39:22 +09:00
ahci_dwc.c ata: ahci-dwc: Add Baikal-T1 AHCI SATA interface support 2022-09-17 01:40:31 +09:00
ahci_imx.c ata: ahci_imx: Fix compilation warning 2022-10-18 08:02:14 +09:00
ahci_mtk.c ata: libahci_platform: Parse ports-implemented property in resources getter 2022-09-17 01:39:30 +09:00
ahci_mvebu.c
ahci_octeon.c ata: octeon: Drop empty platform remove function 2023-01-03 08:39:41 +09:00
ahci_platform.c ata: ahci: Add DWC AHCI SATA controller support 2022-09-17 01:40:15 +09:00
ahci_qoriq.c ata: ahci_qoriq: Fix compilation warning 2022-10-18 08:02:14 +09:00
ahci_seattle.c
ahci_st.c ata: ahci_st: Fix compilation warning 2022-10-17 22:01:57 +09:00
ahci_sunxi.c
ahci_tegra.c
ahci_xgene.c ata: ahci_xgene: Fix compilation warning 2022-10-18 08:02:14 +09:00
ata_generic.c
ata_piix.c
libahci.c ata: libata: respect successfully completed commands during errors 2023-01-04 13:39:19 +09:00
libahci_platform.c ata: libahci_platform: ahci_platform_find_clk: oops, NULL pointer 2022-12-07 08:36:37 +09:00
libata-acpi.c ata: make use of ata_port_is_frozen() helper 2022-10-18 13:53:27 +09:00
libata-core.c ATA changes for 6.3-rc1 2023-02-22 13:35:51 -08:00
libata-eh.c ata: scsi: rename flag ATA_QCFLAG_FAILED to ATA_QCFLAG_EH 2023-01-04 13:36:26 +09:00
libata-pata-timings.c
libata-pmp.c
libata-sata.c ata: libata: read the shared status for successful NCQ commands once 2023-01-04 13:38:14 +09:00
libata-scsi.c SCSI misc on 20230222 2023-02-22 13:41:41 -08:00
libata-sff.c ata: libata: simplify qc_fill_rtf port operation interface 2023-01-04 13:37:45 +09:00
libata-trace.c ata: scsi: rename flag ATA_QCFLAG_FAILED to ATA_QCFLAG_EH 2023-01-04 13:36:26 +09:00
libata-transport.c ata: libata-transport: fix error handling in ata_tdev_add() 2022-11-11 17:26:05 +09:00
libata-transport.h
libata-zpodd.c
libata.h ata: libata: only set sense valid flag if sense data is valid 2022-10-17 11:31:52 +09:00
pata_acpi.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
pata_ali.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
pata_amd.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
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
pata_cs5530.c
pata_cs5535.c ata: pata_cs5535: Fix W=1 warnings 2022-06-30 08:21:43 +09:00
pata_cs5536.c
pata_cypress.c
pata_efar.c
pata_ep93xx.c ata: pata_ep93xx: use devm_platform_get_and_ioremap_resource() 2022-11-12 10:58:56 +09:00
pata_falcon.c
pata_ftide010.c ata: pata_ftide010: Remove build dependency on OF 2022-10-18 08:05:10 +09:00
pata_gayle.c
pata_hpt3x2n.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
pata_hpt3x3.c
pata_hpt37x.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
pata_hpt366.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
pata_icside.c
pata_imx.c
pata_isapnp.c
pata_it821x.c
pata_it8213.c
pata_ixp4xx_cf.c
pata_jmicron.c
pata_legacy.c ata: pata_legacy: fix pdc20230_set_piomode() 2022-10-31 20:27:27 +09:00
pata_macio.c ata: pata_macio: Remove unneeded word in comments 2022-09-16 23:24:06 +09:00
pata_marvell.c ata: pata_marvell: Check the 'bmdma_addr' beforing reading 2022-04-22 08:45:06 +09:00
pata_mpc52xx.c ata: pata_mpc52xx: Replace NO_IRQ with 0 2022-10-17 11:38:15 +09:00
pata_mpiix.c
pata_netcell.c
pata_ninja32.c
pata_ns87410.c
pata_ns87415.c
pata_octeon_cf.c ata: pata_octeon_cf: drop kernel-doc notation 2023-02-14 12:23:37 +09:00
pata_of_platform.c
pata_oldpiix.c
pata_opti.c
pata_optidma.c
pata_pcmcia.c
pata_pdc202xx_old.c
pata_pdc2027x.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
pata_piccolo.c
pata_platform.c
pata_pxa.c
pata_radisys.c
pata_rb532_cf.c
pata_rdc.c
pata_rz1000.c
pata_sc1200.c
pata_sch.c
pata_serverworks.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
pata_sil680.c ata: pata_sil680: fix result type of sil680_sel{dev|reg}() 2022-04-13 12:42:51 +09:00
pata_sis.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
pata_sl82c105.c
pata_triflex.c
pata_via.c ata: make transfer mode masks *unsigned int* 2022-06-17 16:35:02 +09:00
pdc_adma.c
sata_dwc_460ex.c ata: sata_dwc_460ex: Check !irq instead of irq == NO_IRQ 2022-11-12 11:00:04 +09:00
sata_fsl.c ata: libata: simplify qc_fill_rtf port operation interface 2023-01-04 13:37:45 +09:00
sata_gemini.c ata: sata_gemini: Remove dependency on OF for compile tests 2022-10-18 08:04:46 +09:00
sata_gemini.h
sata_highbank.c
sata_inic162x.c ata: libata: simplify qc_fill_rtf port operation interface 2023-01-04 13:37:45 +09:00
sata_mv.c ata: sata_mv: Fixes expected number of resources now IRQs are gone 2022-08-03 07:59:12 +09:00
sata_nv.c ata: make use of ata_port_is_frozen() helper 2022-10-18 13:53:27 +09:00
sata_promise.c ata: scsi: rename flag ATA_QCFLAG_FAILED to ATA_QCFLAG_EH 2023-01-04 13:36:26 +09:00
sata_promise.h
sata_qstor.c
sata_rcar.c ata: sata_rcar: Fix compilation warning 2022-10-18 08:01:45 +09:00
sata_sil.c
sata_sil24.c ata: libata: simplify qc_fill_rtf port operation interface 2023-01-04 13:37:45 +09:00
sata_sis.c
sata_svw.c
sata_sx4.c ata: scsi: rename flag ATA_QCFLAG_FAILED to ATA_QCFLAG_EH 2023-01-04 13:36:26 +09:00
sata_uli.c
sata_via.c
sata_vsc.c
sis.h