Skip to content

Commit

Permalink
isdn_ppp: Add checks for allocation failure in isdn_ppp_open()
Browse files Browse the repository at this point in the history
Compile-tested only.

Signed-off-by: Ben Hutchings <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
bwhacks authored and davem330 committed Nov 2, 2015
1 parent 7091079 commit 0baa57d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/isdn/i4l/isdn_ppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ isdn_ppp_open(int min, struct file *file)
is->compflags = 0;

is->reset = isdn_ppp_ccp_reset_alloc(is);
if (!is->reset)
return -ENOMEM;

is->lp = NULL;
is->mp_seqno = 0; /* MP sequence number */
Expand All @@ -320,6 +322,10 @@ isdn_ppp_open(int min, struct file *file)
* VJ header compression init
*/
is->slcomp = slhc_init(16, 16); /* not necessary for 2. link in bundle */
if (!is->slcomp) {
isdn_ppp_ccp_reset_free(is);
return -ENOMEM;
}
#endif
#ifdef CONFIG_IPPP_FILTER
is->pass_filter = NULL;
Expand Down

0 comments on commit 0baa57d

Please sign in to comment.