[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20061108124622.GF14871@localhost>
Date: Wed, 8 Nov 2006 21:46:22 +0900
From: Akinobu Mita <akinobu.mita@...il.com>
To: linux-kernel@...r.kernel.org
Cc: David Airlie <airlied@...ux.ie>
Subject: [PATCH] drm: fix return value check
class_create() and class_device_create() return error code as a
pointer on failure. These return values need to be checked by
IS_ERR().
Cc: David Airlie <airlied@...ux.ie>
Signed-off-by: Akinobu Mita <akinobu.mita@...il.com>
drivers/char/drm/drm_sysfs.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: work-fault-inject/drivers/char/drm/drm_sysfs.c
===================================================================
--- work-fault-inject.orig/drivers/char/drm/drm_sysfs.c
+++ work-fault-inject/drivers/char/drm/drm_sysfs.c
@@ -45,8 +45,8 @@ struct class *drm_sysfs_create(struct mo
int err;
class = class_create(owner, name);
- if (!class) {
- err = -ENOMEM;
+ if (IS_ERR(class)) {
+ err = PTR_ERR(class);
goto err_out;
}
@@ -113,8 +113,8 @@ struct class_device *drm_sysfs_device_ad
MKDEV(DRM_MAJOR, head->minor),
&(head->dev->pdev)->dev,
"card%d", head->minor);
- if (!class_dev) {
- err = -ENOMEM;
+ if (IS_ERR(class_dev)) {
+ err = PTR_ERR(class_dev);
goto err_out;
}
-
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