Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
10921a8f
Commit
10921a8f
authored
Dec 10, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kobject: fix bug where a parent could be deleted before a child device.
parent
96ce7527
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
lib/kobject.c
lib/kobject.c
+7
-4
No files found.
lib/kobject.c
View file @
10921a8f
...
...
@@ -236,8 +236,6 @@ static void unlink(struct kobject * kobj)
list_del_init
(
&
kobj
->
entry
);
up_write
(
&
kobj
->
kset
->
subsys
->
rwsem
);
}
if
(
kobj
->
parent
)
kobject_put
(
kobj
->
parent
);
kobject_put
(
kobj
);
}
...
...
@@ -274,9 +272,11 @@ int kobject_add(struct kobject * kobj)
kobj
->
parent
=
parent
;
error
=
create_dir
(
kobj
);
if
(
error
)
if
(
error
)
{
unlink
(
kobj
);
else
{
if
(
parent
)
kobject_put
(
parent
);
}
else
{
/* If this kobj does not belong to a kset,
try to find a parent that does. */
top_kobj
=
kobj
;
...
...
@@ -452,6 +452,7 @@ void kobject_cleanup(struct kobject * kobj)
{
struct
kobj_type
*
t
=
get_ktype
(
kobj
);
struct
kset
*
s
=
kobj
->
kset
;
struct
kobject
*
parent
=
kobj
->
parent
;
pr_debug
(
"kobject %s: cleaning up
\n
"
,
kobject_name
(
kobj
));
if
(
kobj
->
k_name
!=
kobj
->
name
)
...
...
@@ -461,6 +462,8 @@ void kobject_cleanup(struct kobject * kobj)
t
->
release
(
kobj
);
if
(
s
)
kset_put
(
s
);
if
(
parent
)
kobject_put
(
parent
);
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment