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
34c3789d
Commit
34c3789d
authored
Apr 21, 2004
by
Dave Jones
Committed by
Dave Jones
Apr 21, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CPUFREQ] Fix unbalanced try_get_module/put_module
Spotted by Charles Coffing <ccoffing@novell.com>
parent
ad2ba7e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
drivers/cpufreq/cpufreq.c
drivers/cpufreq/cpufreq.c
+8
-4
No files found.
drivers/cpufreq/cpufreq.c
View file @
34c3789d
...
@@ -360,8 +360,10 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
...
@@ -360,8 +360,10 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
return
-
EINVAL
;
return
-
EINVAL
;
policy
=
kmalloc
(
sizeof
(
struct
cpufreq_policy
),
GFP_KERNEL
);
policy
=
kmalloc
(
sizeof
(
struct
cpufreq_policy
),
GFP_KERNEL
);
if
(
!
policy
)
if
(
!
policy
)
{
return
-
ENOMEM
;
ret
=
-
ENOMEM
;
goto
nomem_out
;
}
memset
(
policy
,
0
,
sizeof
(
struct
cpufreq_policy
));
memset
(
policy
,
0
,
sizeof
(
struct
cpufreq_policy
));
policy
->
cpu
=
cpu
;
policy
->
cpu
=
cpu
;
...
@@ -410,7 +412,7 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
...
@@ -410,7 +412,7 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
return
0
;
return
0
;
err_out_unregister:
err_out_unregister:
spin_lock_irqsave
(
&
cpufreq_driver_lock
,
flags
);
spin_lock_irqsave
(
&
cpufreq_driver_lock
,
flags
);
cpufreq_cpu_data
[
cpu
]
=
NULL
;
cpufreq_cpu_data
[
cpu
]
=
NULL
;
spin_unlock_irqrestore
(
&
cpufreq_driver_lock
,
flags
);
spin_unlock_irqrestore
(
&
cpufreq_driver_lock
,
flags
);
...
@@ -418,8 +420,10 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
...
@@ -418,8 +420,10 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
kobject_unregister
(
&
policy
->
kobj
);
kobject_unregister
(
&
policy
->
kobj
);
wait_for_completion
(
&
policy
->
kobj_unregister
);
wait_for_completion
(
&
policy
->
kobj_unregister
);
err_out:
err_out:
kfree
(
policy
);
kfree
(
policy
);
nomem_out:
module_put
(
cpufreq_driver
->
owner
);
module_put
(
cpufreq_driver
->
owner
);
return
ret
;
return
ret
;
}
}
...
...
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