From: Rolf Eike Beer <eike-kernel@sf-tec.de>
To: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Greg K-H <greg@kroah.com>, linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [1/9] driver core fixes: make_class_name() retval check
Date: Fri, 22 Sep 2006 11:58:02 +0200 [thread overview]
Message-ID: <200609221158.07226.eike-kernel@sf-tec.de> (raw)
In-Reply-To: <20060922113650.612d425b@gondolin.boeblingen.de.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 763 bytes --]
Cornelia Huck wrote:
> From: Cornelia Huck <cornelia.huck@de.ibm.com>
>
> Make make_class_name() return NULL on error and fixup callers in the
> driver core.
> @@ -409,8 +409,11 @@ static int make_deprecated_class_device_
> return 0;
>
> class_name = make_class_name(class_dev->class->name, &class_dev->kobj);
> - error = sysfs_create_link(&class_dev->dev->kobj, &class_dev->kobj,
> - class_name);
> + if (!class_name)
> + error = sysfs_create_link(&class_dev->dev->kobj,
> + &class_dev->kobj, class_name);
> + else
> + error = -ENOMEM;
> kfree(class_name);
> return error;
> }
Either this is inverse of what you wanted to do or just calling
sysfs_create_link(..., NULL) would make it clearer for readers.
Eike
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2006-09-22 9:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-22 9:36 [1/9] driver core fixes: make_class_name() retval check Cornelia Huck
2006-09-22 9:58 ` Rolf Eike Beer [this message]
2006-09-22 10:22 ` Cornelia Huck
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=200609221158.07226.eike-kernel@sf-tec.de \
--to=eike-kernel@sf-tec.de \
--cc=cornelia.huck@de.ibm.com \
--cc=greg@kroah.com \
--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.