From: Peter Oberparleiter Date: Wed, 1 Feb 2006 11:06:35 +0000 (-0800) Subject: [PATCH] s390: ccw_device_probe_console return value X-Git-Tag: v2.6.16-rc2~38 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=600b5d163d7434332539cac7be00f649cbbfedcc;p=linux-2.6 [PATCH] s390: ccw_device_probe_console return value The return code of ccw_device_probe_console() is not properly handled. It should only return a valid ccw device pointer or a error value converted by ERR_PTR. Fix the console driver code to check with IS_ERR instead against NULL. Signed-off-by: Peter Oberparleiter Signed-off-by: Martin Schwidefsky Signed-off-by: Heiko Carstens Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 1f060914cf..606f6ad285 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -864,7 +865,7 @@ con3215_init(void) } cdev = ccw_device_probe_console(); - if (!cdev) + if (IS_ERR(cdev)) return -ENODEV; raw3215[0] = raw = (struct raw3215_info *) diff --git a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c index c570a9f6ce..ef607a1de5 100644 --- a/drivers/s390/char/con3270.c +++ b/drivers/s390/char/con3270.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -597,7 +598,7 @@ con3270_init(void) } cdev = ccw_device_probe_console(); - if (!cdev) + if (IS_ERR(cdev)) return -ENODEV; rp = raw3270_setup_console(cdev); if (IS_ERR(rp)) diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index ceebf08e09..0b30921ce6 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -1012,7 +1012,7 @@ ccw_device_probe_console(void) int ret; if (xchg(&console_cdev_in_use, 1) != 0) - return NULL; + return ERR_PTR(-EBUSY); sch = cio_probe_console(); if (IS_ERR(sch)) { console_cdev_in_use = 0;