netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net 1/2] isdn_ppp: Add checks for allocation failure in isdn_ppp_open()
@ 2015-11-01 16:21 Ben Hutchings
  2015-11-01 16:22 ` [PATCH v2 net 2/2] ppp, slip: Validate VJ compression slot parameters completely Ben Hutchings
  2015-11-02 21:25 ` [PATCH v2 net 1/2] isdn_ppp: Add checks for allocation failure in isdn_ppp_open() David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Ben Hutchings @ 2015-11-01 16:21 UTC (permalink / raw)
  To: David Miller; +Cc: Karsten Keil, linux-ppp, netdev

[-- Attachment #1: Type: text/plain, Size: 971 bytes --]

Compile-tested only.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
Re-sent using mutt since Evolution 3.18 mangles patches.

Ben.

 drivers/isdn/i4l/isdn_ppp.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
index c4198fa..86f9abe 100644
--- a/drivers/isdn/i4l/isdn_ppp.c
+++ b/drivers/isdn/i4l/isdn_ppp.c
@@ -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 */
@@ -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;


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-02 21:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-01 16:21 [PATCH v2 net 1/2] isdn_ppp: Add checks for allocation failure in isdn_ppp_open() Ben Hutchings
2015-11-01 16:22 ` [PATCH v2 net 2/2] ppp, slip: Validate VJ compression slot parameters completely Ben Hutchings
2015-11-02 21:25   ` David Miller
2015-11-02 21:25 ` [PATCH v2 net 1/2] isdn_ppp: Add checks for allocation failure in isdn_ppp_open() David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).