projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
077d995
)
power: charger-manager: fix a potential NULL pointer dereference
author
Kangjie Lu
<kjlu@umn.edu>
Thu, 14 Mar 2019 06:02:47 +0000
(
01:02
-0500)
committer
Sebastian Reichel
<sebastian.reichel@collabora.com>
Fri, 5 Apr 2019 14:00:06 +0000
(16:00 +0200)
In case create_freezable_workqueue fails, the fix return -ENOMEM
to avoid a potential NULL pointer dereference.
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/charger-manager.c
patch
|
blob
|
history
diff --git
a/drivers/power/supply/charger-manager.c
b/drivers/power/supply/charger-manager.c
index
2e8db5e
..
a6900aa
100644
(file)
--- a/
drivers/power/supply/charger-manager.c
+++ b/
drivers/power/supply/charger-manager.c
@@
-1987,6
+1987,9
@@
static struct platform_driver charger_manager_driver = {
static int __init charger_manager_init(void)
{
cm_wq = create_freezable_workqueue("charger_manager");
+ if (unlikely(!cm_wq))
+ return -ENOMEM;
+
INIT_DELAYED_WORK(&cm_monitor_work, cm_monitor_poller);
return platform_driver_register(&charger_manager_driver);