mISDN: correctly handling failed allocation in fsm
Subsystems (2)
PATCH 1/1 mISDN: correctly handling failed allocation in fsm
Since kzalloc can be failed in memory pressure,
NULL dereference can be happened.
Signed-off-by Insu Yun <[email protected]>
--- drivers/isdn/mISDN/fsm.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/isdn/mISDN/fsm.c +2 -0
@@ -34,6 +34,8 @@ mISDN_FsmNew(struct Fsm *fsm, fsm->jumpmatrix =kzalloc (sizeof (FSMFNPTR ) * fsm->state_count * fsm->event_count,GFP_KERNEL ); +if (!fsm->jumpmatrix) +return ;for (i =0 ; i < fncount; i++) if ((fnlist[i].state >= fsm->state_count) ||
Signature · 1 line
1.9.1
David Miller
maintainerFrom: Insu Yun <[email protected]>
Date: Tue, 29 Dec 2015 16:41:33 -0500
Quoted 4 lines
Since kzalloc can be failed in memory pressure,
NULL dereference can be happened.Signed-off-by Insu Yun <[email protected]>
Similarly to your other mISDN patch you must propagate and handle errors properly.