diff options
| author | Patrick Mochel <mochel@osdl.org> | 2002-12-19 03:46:29 -0600 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2002-12-19 03:46:29 -0600 |
| commit | 039294682d6a32455623da81076597a6f8da39b3 (patch) | |
| tree | 0185e759574e1c6bd1772a3ec47e6b1830ce1390 /include/linux/kobject.h | |
| parent | 75fb58eebfbaca27864b925e49370ccbf1bc33ba (diff) | |
kobjects: minor updates
- check if subsystem is NULL during subsys_get().
- Don't increment parent's reference count before we check if we have a
valid kobject during kobject_add()
- Do kobject_add() in subsys_register(), instead of kobject_register(),
since we've already done kobject_init().
Diffstat (limited to 'include/linux/kobject.h')
| -rw-r--r-- | include/linux/kobject.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 6b528c5a61cb..821d17e15a01 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -52,7 +52,7 @@ extern void subsystem_unregister(struct subsystem *); static inline struct subsystem * subsys_get(struct subsystem * s) { - return container_of(kobject_get(&s->kobj),struct subsystem,kobj); + return s ? container_of(kobject_get(&s->kobj),struct subsystem,kobj) : NULL; } static inline void subsys_put(struct subsystem * s) |
