From: Akinobu Mita <akinobu.mita@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: David Airlie <airlied@linux.ie>
Subject: [PATCH] drm: fix return value check
Date: Wed, 8 Nov 2006 21:46:22 +0900 [thread overview]
Message-ID: <20061108124622.GF14871@localhost> (raw)
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@linux.ie>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.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;
}
reply other threads:[~2006-11-08 12:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061108124622.GF14871@localhost \
--to=akinobu.mita@gmail.com \
--cc=airlied@linux.ie \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.