Linux PPP protocol development
 help / color / mirror / Atom feed
* [PATCH net 1/2] isdn_ppp: Add checks for allocation failure in isdn_ppp_open()
@ 2015-10-14 17:51 Ben Hutchings
  2015-10-14 17:53 ` [PATCH 2/2] ppp, slip: Validate VJ compression slot parameters completely Ben Hutchings
  2015-10-16  7:46 ` [PATCH net 1/2] isdn_ppp: Add checks for allocation failure in isdn_ppp_open() David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Ben Hutchings @ 2015-10-14 17:51 UTC (permalink / raw)
  To: David Miller; +Cc: Karsten Keil, linux-ppp, netdev

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

Compile-tested only.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 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;

-- 
Ben Hutchings
[W]e found...that it wasn't as easy to get programs right as we had thought.
... I realized that a large part of my life from then on was going to be spent
in finding mistakes in my own programs. - Maurice Wilkes, 1949

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

end of thread, other threads:[~2015-11-01 16:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-14 17:51 [PATCH net 1/2] isdn_ppp: Add checks for allocation failure in isdn_ppp_open() Ben Hutchings
2015-10-14 17:53 ` [PATCH 2/2] ppp, slip: Validate VJ compression slot parameters completely Ben Hutchings
2015-10-16  7:46 ` [PATCH net 1/2] isdn_ppp: Add checks for allocation failure in isdn_ppp_open() David Miller
2015-10-30 13:03   ` Josh Boyer
2015-11-01 16:23     ` Ben Hutchings
2015-11-01 16:23   ` Ben Hutchings

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox