From: Mariusz Kozlowski <[email protected]> This patch removes redundant argument checks for kobject_put(). Signed-off-by: Mariusz Kozlowski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> --- lib/kobject.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/kobject.c b/lib/kobject.c index c033dc8..74b8dbc 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -195,8 +195,7 @@ int kobject_add(struct kobject * kobj) if (error) { /* unlink does the kobject_put() for us */ unlink(kobj); - if (parent) - kobject_put(parent); + kobject_put(parent); /* be noisy on error issues */ if (error == -EEXIST) @@ -420,8 +419,7 @@ void kobject_cleanup(struct kobject * kobj) t->release(kobj); if (s) kset_put(s); - if (parent) - kobject_put(parent); + kobject_put(parent); } static void kobject_release(struct kref *kref) -- 1.4.4.4 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- References:
- [GIT PATCH] Driver core patches for 2.6.20
- From: Greg KH <[email protected]>
- [PATCH 1/28] Kobject: make kobject apis more robust in handling NULL pointers
- From: Greg KH <[email protected]>
- [PATCH 2/28] Driver core: convert pcmcia code to use struct device
- From: Greg KH <[email protected]>
- [PATCH 3/28] Driver core: convert SPI code to use struct device
- From: Greg KH <[email protected]>
- [PATCH 4/28] Network: convert network devices to use struct device instead of class_device
- From: Greg KH <[email protected]>
- [PATCH 5/28] driver core: Remove device_is_registered() in device_move().
- From: Greg KH <[email protected]>
- [PATCH 6/28] driver core: Allow device_move(dev, NULL).
- From: Greg KH <[email protected]>
- [PATCH 7/28] MODULES: add the module name for built in kernel drivers
- From: Greg KH <[email protected]>
- [PATCH 8/28] Modules: only add drivers/ direcory if needed
- From: Greg KH <[email protected]>
- [PATCH 9/28] PCI: add the sysfs driver name to all modules
- From: Greg KH <[email protected]>
- [PATCH 10/28] SERIO: add the sysfs driver name to all modules
- From: Greg KH <[email protected]>
- [PATCH 11/28] USB: add the sysfs driver name to all modules
- From: Greg KH <[email protected]>
- [PATCH 12/28] /sys/modules/*/holders
- From: Greg KH <[email protected]>
- [PATCH 13/28] driver core fixes: make_class_name() retval checks
- From: Greg KH <[email protected]>
- [PATCH 14/28] driver core fixes: device_register() retval check in platform.c
- From: Greg KH <[email protected]>
- [PATCH 15/28] driver core: Don't stop probing on ->probe errors.
- From: Greg KH <[email protected]>
- [PATCH 16/28] driver core: Change function call order in device_bind_driver().
- From: Greg KH <[email protected]>
- [PATCH 17/28] Driver core: fix race in sysfs between sysfs_remove_file() and read()/write()
- From: Greg KH <[email protected]>
- [PATCH 18/28] sysfs: suppress lockdep warnings
- From: Greg KH <[email protected]>
- [PATCH 19/28] sysfs: kobject_put cleanup
- From: Greg KH <[email protected]>
- [GIT PATCH] Driver core patches for 2.6.20
- Prev by Date: [PATCH 27/28] Driver Core: Increase the default timeout value of the firmware subsystem
- Next by Date: [PATCH 19/28] sysfs: kobject_put cleanup
- Previous by thread: [PATCH 19/28] sysfs: kobject_put cleanup
- Next by thread: [PATCH 21/28] sysfs: error handling in sysfs, fill_read_buffer()
- Index(es):