projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fd57770
)
net/smc: fix a NULL pointer dereference
author
Kangjie Lu
<
[email protected]
>
Thu, 11 Apr 2019 09:17:31 +0000
(11:17 +0200)
committer
David S. Miller
<
[email protected]
>
Thu, 11 Apr 2019 18:04:08 +0000
(11:04 -0700)
In case alloc_ordered_workqueue fails, the fix returns NULL
to avoid NULL pointer dereference.
Signed-off-by: Kangjie Lu <
[email protected]
>
Signed-off-by: Ursula Braun <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/smc/smc_ism.c
patch
|
blob
|
history
diff --git
a/net/smc/smc_ism.c
b/net/smc/smc_ism.c
index 2fff79db1a59ce3d2908722941dd9355810c65a0..e89e918b88e09acaad980da8dc34e3d921fe69be 100644
(file)
--- a/
net/smc/smc_ism.c
+++ b/
net/smc/smc_ism.c
@@
-289,6
+289,11
@@
struct smcd_dev *smcd_alloc_dev(struct device *parent, const char *name,
INIT_LIST_HEAD(&smcd->vlan);
smcd->event_wq = alloc_ordered_workqueue("ism_evt_wq-%s)",
WQ_MEM_RECLAIM, name);
+ if (!smcd->event_wq) {
+ kfree(smcd->conn);
+ kfree(smcd);
+ return NULL;
+ }
return smcd;
}
EXPORT_SYMBOL_GPL(smcd_alloc_dev);