Skip to content

Commit 145d9b4

Browse files
committed
Merge tag 'ata-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata
Pull ATA fix from Damien Le Moal: "A single fix for 5.17-rc2, adding a missing resource allocation error check in the pata_platform driver, from Zhou" * tag 'ata-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: pata_platform: Fix a NULL pointer dereference in __pata_platform_probe()
2 parents 374630e + 9b6d90e commit 145d9b4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/ata/pata_platform.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ int __pata_platform_probe(struct device *dev, struct resource *io_res,
128128
ap = host->ports[0];
129129

130130
ap->ops = devm_kzalloc(dev, sizeof(*ap->ops), GFP_KERNEL);
131+
if (!ap->ops)
132+
return -ENOMEM;
131133
ap->ops->inherits = &ata_sff_port_ops;
132134
ap->ops->cable_detect = ata_cable_unknown;
133135
ap->ops->set_mode = pata_platform_set_mode;

0 commit comments

Comments
 (0)