Skip to content

Commit

Permalink
pata_platform: Fix NULL pointer dereference
Browse files Browse the repository at this point in the history
pata_platform: Fix NULL pointer dereference

pata_platform currently dereferences a NULL pointer in pata_platform_probe()
if pdev->dev.platform_data is set to NULL. This breakage was most likely
introduced by commit 5f45bc5.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Magnus Damm authored and Jeff Garzik committed Jul 20, 2007
1 parent 0ea9e17 commit 83b6839
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/ata/pata_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,9 @@ static int __devinit pata_platform_probe(struct platform_device *pdev)
pata_platform_setup_port(&ap->ioaddr, pp_info);

/* activate */
return ata_host_activate(host, platform_get_irq(pdev, 0), ata_interrupt,
pp_info->irq_flags, &pata_platform_sht);
return ata_host_activate(host, platform_get_irq(pdev, 0),
ata_interrupt, pp_info ? pp_info->irq_flags
: 0, &pata_platform_sht);
}

/**
Expand Down

0 comments on commit 83b6839

Please sign in to comment.