[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061122184755.GD2985@APFDCB5C>
Date: Thu, 23 Nov 2006 03:47:55 +0900
From: Akinobu Mita <akinobu.mita@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Jeff Garzik <jgarzik@...ox.com>, Alan <alan@...rguk.ukuu.org.uk>
Subject: [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 <jgarzik@...ox.com>
Cc: Alan <alan@...rguk.ukuu.org.uk>
Signed-off-by: Akinobu Mita <akinobu.mita@...il.com>
---
drivers/ata/pata_legacy.c | 4 +++-
drivers/ata/pata_qdi.c | 4 ++--
drivers/ata/pata_winbond.c | 4 ++--
3 files changed, 7 insertions(+), 5 deletions(-)
Index: work-fault-inject/drivers/ata/pata_legacy.c
===================================================================
--- work-fault-inject.orig/drivers/ata/pata_legacy.c
+++ work-fault-inject/drivers/ata/pata_legacy.c
@@ -698,8 +698,10 @@ static __init int legacy_init_one(int po
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;
Index: work-fault-inject/drivers/ata/pata_qdi.c
===================================================================
--- work-fault-inject.orig/drivers/ata/pata_qdi.c
+++ work-fault-inject/drivers/ata/pata_qdi.c
@@ -247,8 +247,8 @@ static __init int qdi_init_one(unsigned
*/
pdev = platform_device_register_simple(DRV_NAME, nr_qdi_host, NULL, 0);
- if (pdev == NULL)
- return -ENOMEM;
+ if (IS_ERR(pdev))
+ return PTR_ERR(pdev);
memset(&ae, 0, sizeof(struct ata_probe_ent));
INIT_LIST_HEAD(&ae.node);
Index: work-fault-inject/drivers/ata/pata_winbond.c
===================================================================
--- work-fault-inject.orig/drivers/ata/pata_winbond.c
+++ work-fault-inject/drivers/ata/pata_winbond.c
@@ -206,8 +206,8 @@ static __init int winbond_init_one(unsig
*/
pdev = platform_device_register_simple(DRV_NAME, nr_winbond_host, NULL, 0);
- if (pdev == NULL)
- return -ENOMEM;
+ if (IS_ERR(pdev))
+ return PTR_ERR(pdev);
memset(&ae, 0, sizeof(struct ata_probe_ent));
INIT_LIST_HEAD(&ae.node);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists