diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2006-12-08 18:49:47 -0500 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2006-12-11 02:28:45 -0500 |
commit | 94f060bd0f78814f4daf8c7942bd710af52c7d6f (patch) | |
tree | c18ba952bebbaf73497d9cd593bb9d023e81331d /drivers/char/drm/drm_sysfs.c | |
parent | 9202f32558601c2c99ddc438eb3218131d00d413 (diff) |
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().
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/drm_sysfs.c')
-rw-r--r-- | drivers/char/drm/drm_sysfs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/char/drm/drm_sysfs.c b/drivers/char/drm/drm_sysfs.c index ba4b8de83cf0..cc8e2ebe128c 100644 --- a/drivers/char/drm/drm_sysfs.c +++ b/drivers/char/drm/drm_sysfs.c | |||
@@ -45,8 +45,8 @@ struct class *drm_sysfs_create(struct module *owner, char *name) | |||
45 | int err; | 45 | int err; |
46 | 46 | ||
47 | class = class_create(owner, name); | 47 | class = class_create(owner, name); |
48 | if (!class) { | 48 | if (IS_ERR(class)) { |
49 | err = -ENOMEM; | 49 | err = PTR_ERR(class); |
50 | goto err_out; | 50 | goto err_out; |
51 | } | 51 | } |
52 | 52 | ||
@@ -113,8 +113,8 @@ struct class_device *drm_sysfs_device_add(struct class *cs, drm_head_t *head) | |||
113 | MKDEV(DRM_MAJOR, head->minor), | 113 | MKDEV(DRM_MAJOR, head->minor), |
114 | &(head->dev->pdev)->dev, | 114 | &(head->dev->pdev)->dev, |
115 | "card%d", head->minor); | 115 | "card%d", head->minor); |
116 | if (!class_dev) { | 116 | if (IS_ERR(class_dev)) { |
117 | err = -ENOMEM; | 117 | err = PTR_ERR(class_dev); |
118 | goto err_out; | 118 | goto err_out; |
119 | } | 119 | } |
120 | 120 | ||