Cornelia Huck wrote: > From: Cornelia Huck <[email protected]> > > 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:
pgp2szFW43GEd.pgp
Description: PGP signature
- Follow-Ups:
- Re: [1/9] driver core fixes: make_class_name() retval check
- From: Cornelia Huck <[email protected]>
- Re: [1/9] driver core fixes: make_class_name() retval check
- References:
- [1/9] driver core fixes: make_class_name() retval check
- From: Cornelia Huck <[email protected]>
- [1/9] driver core fixes: make_class_name() retval check
- Prev by Date: Re: [patch 1/2] sched: introduce child field in sched_domain
- Next by Date: Different value in journal block after crash?
- Previous by thread: [1/9] driver core fixes: make_class_name() retval check
- Next by thread: Re: [1/9] driver core fixes: make_class_name() retval check
- Index(es):