WSL2-Linux-Kernel/drivers/ata
Zhou Qingyang 9b6d90e208 ata: pata_platform: Fix a NULL pointer dereference in __pata_platform_probe()
In __pata_platform_probe(), devm_kzalloc() is assigned to ap->ops and
there is a dereference of it right after that, which could introduce a
NULL pointer dereference bug.

Fix this by adding a NULL check of ap->ops.

This bug was found by a static analyzer.

Builds with 'make allyesconfig' show no new warnings,
and our static analyzer no longer warns about this code.

Fixes: f3d5e4f18d ("ata: pata_of_platform: Allow to use 16-bit wide data transfer")
Signed-off-by: Zhou Qingyang <zhou1615@umn.edu>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
2022-01-27 11:22:43 +09:00
..
Kconfig ata: pata_samsung_cf: add compile test support 2022-01-14 15:17:17 +09:00
Makefile
acard-ahci.c ata: libata: remove pointless debugging messages 2022-01-04 20:00:35 +09:00
ahci.c ata: ahci: Add support for AMD A85 FCH (Hudson D4) 2022-01-14 15:17:17 +09:00
ahci.h scsi: ata: Switch to attribute groups 2021-10-16 21:45:52 -04:00
ahci_brcm.c ata: libata: Rename link flag ATA_LFLAG_NO_DB_DELAY 2022-01-14 15:17:17 +09:00
ahci_ceva.c ata: fix read_id() ata port operation interface 2022-01-14 15:17:16 +09:00
ahci_da850.c
ahci_dm816.c
ahci_imx.c
ahci_mtk.c
ahci_mvebu.c
ahci_octeon.c
ahci_platform.c
ahci_qoriq.c ata: libata: add reset tracepoints 2022-01-04 20:00:57 +09:00
ahci_seattle.c
ahci_st.c
ahci_sunxi.c
ahci_tegra.c
ahci_xgene.c ata: fix read_id() ata port operation interface 2022-01-14 15:17:16 +09:00
ata_generic.c
ata_piix.c ata: libata: tracepoints for bus-master DMA 2022-01-05 19:32:51 +09:00
libahci.c ata: ahci: Drop pointless VPRINTK() calls and convert the remaining ones 2022-01-05 19:33:01 +09:00
libahci_platform.c ata: libahci_platform: Get rid of dup message when IRQ can't be retrieved 2022-01-04 20:00:12 +09:00
libata-acpi.c ata: libata: drop ata_msg_probe() 2022-01-05 19:33:02 +09:00
libata-core.c ata: fix read_id() ata port operation interface 2022-01-14 15:17:16 +09:00
libata-eh.c ata: libata: drop ata_msg_drv() 2022-01-05 19:33:02 +09:00
libata-pata-timings.c
libata-pmp.c ata: libata: add tracepoints for ATA error handling 2022-01-05 19:33:01 +09:00
libata-sata.c ata: libata: Rename link flag ATA_LFLAG_NO_DB_DELAY 2022-01-14 15:17:17 +09:00
libata-scsi.c ata: libata-scsi: simplify __ata_scsi_queuecmd() 2022-01-14 15:17:17 +09:00
libata-sff.c ata: libata: remove debug compilation switches 2022-01-05 19:33:02 +09:00
libata-trace.c ata: libata-sff: tracepoints for HSM state machine 2022-01-05 19:33:01 +09:00
libata-transport.c ata: libata: Add ata_port_classify() helper 2022-01-04 20:00:45 +09:00
libata-transport.h
libata-zpodd.c
libata.h ata: libata: remove pointless VPRINTK() calls 2022-01-05 19:33:01 +09:00
pata_acpi.c
pata_ali.c ata: pata_ali: remove redundant return statement 2022-01-14 15:17:17 +09:00
pata_amd.c pata_amd: fix checking of DMA state 2021-10-12 17:46:55 +09:00
pata_arasan_cf.c ata: libata: tracepoints for bus-master DMA 2022-01-05 19:32:51 +09:00
pata_artop.c
pata_atiixp.c
pata_atp867x.c ata: pata_atp867x: convert printk() calls 2022-01-05 19:33:02 +09:00
pata_bk3710.c
pata_buddha.c
pata_cmd64x.c ata: pata_cmd64x: convert printk() calls 2022-01-05 19:33:03 +09:00
pata_cmd640.c ata: pata_cmd640: convert printk() calls 2022-01-05 19:33:02 +09:00
pata_cs5520.c ata: pata_cs5520: convert printk() calls 2022-01-05 19:33:03 +09:00
pata_cs5530.c
pata_cs5535.c
pata_cs5536.c ata: pata_cs5536: convert printk() calls 2022-01-05 19:33:03 +09:00
pata_cypress.c ata: pata_cypress: convert printk() calls 2022-01-05 19:33:03 +09:00
pata_efar.c
pata_ep93xx.c ata: libata: remove debug compilation switches 2022-01-05 19:33:02 +09:00
pata_falcon.c pata_falcon: Avoid type warnings from sparse 2021-11-29 20:28:13 +09:00
pata_ftide010.c
pata_gayle.c
pata_hpt3x2n.c ata: pata_hpt3x2n: convert pr_XXX() calls 2022-01-05 19:33:03 +09:00
pata_hpt3x3.c
pata_hpt37x.c ata: pata_hpt37x: convert pr_XXX() calls 2022-01-05 19:33:03 +09:00
pata_hpt366.c ata: pata_hpt366: convert pr_warn() calls 2022-01-05 19:33:03 +09:00
pata_icside.c
pata_imx.c
pata_isapnp.c
pata_it821x.c ata: fix read_id() ata port operation interface 2022-01-14 15:17:16 +09:00
pata_it8213.c
pata_ixp4xx_cf.c ata: libata: move ata_{port,link,dev}_dbg to standard pr_XXX() macros 2022-01-05 19:33:01 +09:00
pata_jmicron.c
pata_legacy.c pata_legacy: fix a couple uninitialized variable bugs 2021-10-12 09:52:35 +09:00
pata_macio.c scsi: ata: Switch to attribute groups 2021-10-16 21:45:52 -04:00
pata_marvell.c ata: pata_marvell: convert printk() calls 2022-01-05 19:33:03 +09:00
pata_mpc52xx.c
pata_mpiix.c
pata_netcell.c ata: fix read_id() ata port operation interface 2022-01-14 15:17:16 +09:00
pata_ninja32.c
pata_ns87410.c
pata_ns87415.c
pata_octeon_cf.c ata: pata_octeon_cf: fix call to trace_ata_bmdma_stop() 2022-01-21 18:39:16 +09:00
pata_of_platform.c ata: pata_of_platform: Use platform_get_irq_optional() to get the interrupt 2022-01-14 15:17:17 +09:00
pata_oldpiix.c
pata_opti.c
pata_optidma.c pata_optidma: fix checking of DMA state 2021-10-12 17:46:59 +09:00
pata_palmld.c
pata_pcmcia.c
pata_pdc202xx_old.c ata: libata: tracepoints for bus-master DMA 2022-01-05 19:32:51 +09:00
pata_pdc2027x.c ata: pata_pdc2027x: Replace PDPRINTK() with standard ata logging 2022-01-05 19:33:01 +09:00
pata_piccolo.c
pata_platform.c ata: pata_platform: Fix a NULL pointer dereference in __pata_platform_probe() 2022-01-27 11:22:43 +09:00
pata_pxa.c
pata_radisys.c pata_radisys: fix checking of DMA state 2021-10-12 17:47:02 +09:00
pata_rb532_cf.c
pata_rdc.c
pata_rz1000.c ata: pata_rz1000: convert printk() calls 2022-01-05 19:33:03 +09:00
pata_samsung_cf.c
pata_sc1200.c
pata_sch.c
pata_serverworks.c ata: pata_serverworks: convert printk() calls 2022-01-05 19:33:03 +09:00
pata_sil680.c ata: pata_sil680: convert printk() calls 2022-01-05 19:33:03 +09:00
pata_sis.c
pata_sl82c105.c
pata_triflex.c
pata_via.c ata: pata_via: Drop pointless VPRINTK() calls 2022-01-05 19:33:01 +09:00
pdc_adma.c ata: pdc_adma: Drop pointless VPRINTK() calls and remove disabled NCQ debugging 2022-01-05 19:33:01 +09:00
sata_dwc_460ex.c ata: sata_dwc_460ex: Remove debug compile options 2022-01-05 19:33:03 +09:00
sata_fsl.c ata: sata_fsl: fix cmdhdr_tbl_entry and prde struct definitions 2022-01-14 15:17:16 +09:00
sata_gemini.c ata: sata_gemini: convert pr_err() calls 2022-01-05 19:33:03 +09:00
sata_gemini.h
sata_highbank.c ata: sata_highbank: Remove unnecessary print function dev_err() 2021-11-11 10:55:32 +09:00
sata_inic162x.c ata: sata_inic162x: Drop pointless VPRINTK() calls 2022-01-05 19:33:02 +09:00
sata_mv.c ata: sata_mv: convert remaining printk() to structured logging 2022-01-05 19:33:03 +09:00
sata_nv.c ata: sata_nv: drop pointless VPRINTK() calls and convert remaining ones 2022-01-05 19:33:02 +09:00
sata_promise.c ata: sata_promise: Drop pointless VPRINTK() calls and convert the remaining ones 2022-01-05 19:33:01 +09:00
sata_promise.h
sata_qstor.c ata: sata_qstor: Drop pointless VPRINTK() calls 2022-01-05 19:33:02 +09:00
sata_rcar.c ata: libata: remove debug compilation switches 2022-01-05 19:33:02 +09:00
sata_sil.c ata: sata_sil: Drop pointless VPRINTK() calls 2022-01-05 19:33:02 +09:00
sata_sil24.c ata: libata: add reset tracepoints 2022-01-04 20:00:57 +09:00
sata_sis.c
sata_svw.c
sata_sx4.c ata: sata_sx4: convert printk() calls 2022-01-05 19:33:03 +09:00
sata_uli.c
sata_via.c
sata_vsc.c
sis.h