projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
72d8b4f
)
isdn: mISDN: Fix potential NULL pointer dereference of kzalloc
author
Aditya Pakki
<pakki001@umn.edu>
Sat, 2 Mar 2019 21:20:43 +0000
(15:20 -0600)
committer
David S. Miller
<davem@davemloft.net>
Mon, 4 Mar 2019 18:54:48 +0000
(10:54 -0800)
Allocating memory via kzalloc for phi may fail and causes a
NULL pointer dereference. This patch avoids such a scenario.
Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/isdn/hardware/mISDN/hfcsusb.c
patch
|
blob
|
history
diff --git
a/drivers/isdn/hardware/mISDN/hfcsusb.c
b/drivers/isdn/hardware/mISDN/hfcsusb.c
index
124ff53
..
26e3182
100644
(file)
--- a/
drivers/isdn/hardware/mISDN/hfcsusb.c
+++ b/
drivers/isdn/hardware/mISDN/hfcsusb.c
@@
-263,6
+263,9
@@
hfcsusb_ph_info(struct hfcsusb *hw)
int i;
phi = kzalloc(struct_size(phi, bch, dch->dev.nrbchan), GFP_ATOMIC);
+ if (!phi)
+ return;
+
phi->dch.ch.protocol = hw->protocol;
phi->dch.ch.Flags = dch->Flags;
phi->dch.state = dch->state;