lkml.org 
[lkml]   [2006]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [1/9] driver core fixes: make_class_name() retval check
Date
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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2006-09-22 12:01    [from the cache]
©2003-2011 Jasper Spaans