* [PATCH] ata: fix platform_device_register_simple() error check
@ 2006-11-22 18:47 Akinobu Mita
2006-11-22 19:21 ` Alan
0 siblings, 1 reply; 2+ messages in thread
From: Akinobu Mita @ 2006-11-22 18:47 UTC (permalink / raw)
To: linux-kernel; +Cc: Jeff Garzik, Alan
The return value of platform_device_register_simple() should be checked
by IS_ERR().
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Alan <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.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);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ata: fix platform_device_register_simple() error check
2006-11-22 18:47 [PATCH] ata: fix platform_device_register_simple() error check Akinobu Mita
@ 2006-11-22 19:21 ` Alan
0 siblings, 0 replies; 2+ messages in thread
From: Alan @ 2006-11-22 19:21 UTC (permalink / raw)
To: Akinobu Mita, akpm; +Cc: linux-kernel, Jeff Garzik
On Thu, 23 Nov 2006 03:47:55 +0900
Akinobu Mita <akinobu.mita@gmail.com> wrote:
> The return value of platform_device_register_simple() should be checked
> by IS_ERR().
>
> Cc: Jeff Garzik <jgarzik@pobox.com>
> Cc: Alan <alan@lxorguk.ukuu.org.uk>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Thanks for noticing that one.
Acked-by: Alan Cox <alan@redhat.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-11-22 19:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-22 18:47 [PATCH] ata: fix platform_device_register_simple() error check Akinobu Mita
2006-11-22 19:21 ` Alan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.