From: Akinobu Mita Date: Fri, 15 Dec 2006 21:08:51 +0000 (-0800) Subject: [PATCH] ata: fix platform_device_register_simple() error check X-Git-Tag: v2.6.20-rc2~123^2~3 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9825d73ceb6cad9b9c2ee2dc2971b58dbe8623cd;p=pandora-kernel.git [PATCH] ata: fix platform_device_register_simple() error check The return value of platform_device_register_simple() should be checked by IS_ERR(). Cc: Jeff Garzik Acked-by: Alan Cox Signed-off-by: Akinobu Mita Signed-off-by: Andrew Morton Signed-off-by: Jeff Garzik --- diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c index c7d1738e4e69..e7bf9d89c8ee 100644 --- a/drivers/ata/pata_legacy.c +++ b/drivers/ata/pata_legacy.c @@ -698,8 +698,10 @@ static __init int legacy_init_one(int port, unsigned long io, unsigned long ctrl goto fail_io; pdev = platform_device_register_simple(DRV_NAME, nr_legacy_host, NULL, 0); - if (pdev == NULL) + if (IS_ERR(pdev)) { + ret = PTR_ERR(pdev); goto fail_dev; + } if (ht6560a & mask) { ops = &ht6560a_port_ops; Reading git-diff-tree failed