diff mbox

[net,1/2] isdn_ppp: Add checks for allocation failure in isdn_ppp_open()

Message ID 1444845074.31451.21.camel@decadent.org.uk
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Ben Hutchings Oct. 14, 2015, 5:51 p.m. UTC
Compile-tested only.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/isdn/i4l/isdn_ppp.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

David Miller Oct. 16, 2015, 7:46 a.m. UTC | #1
From: Ben Hutchings <ben@decadent.org.uk>
Date: Wed, 14 Oct 2015 18:51:14 +0100

> 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;

Ben, your email client has corrupted both of these patches.

Please fix this up and resubmit, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Josh Boyer Oct. 30, 2015, 1:03 p.m. UTC | #2
On Fri, Oct 16, 2015 at 3:46 AM, David Miller <davem@davemloft.net> wrote:
> From: Ben Hutchings <ben@decadent.org.uk>
> Date: Wed, 14 Oct 2015 18:51:14 +0100
>
>> 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;
>
> Ben, your email client has corrupted both of these patches.
>
> Please fix this up and resubmit, thanks.

Ben, did you resubmit these as David suggested?  I haven't found a v2 anywhere.

josh
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ben Hutchings Nov. 1, 2015, 4:23 p.m. UTC | #3
On Fri, 2015-10-16 at 00:46 -0700, David Miller wrote:
> From: Ben Hutchings <ben@decadent.org.uk>
> Date: Wed, 14 Oct 2015 18:51:14 +0100
> 
> > 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;
> 
> Ben, your email client has corrupted both of these patches.
> 
> Please fix this up and resubmit, thanks.

Sorry about that; it is a regression in Evolution 3.18.

Ben.
Ben Hutchings Nov. 1, 2015, 4:23 p.m. UTC | #4
On Fri, 2015-10-30 at 09:03 -0400, Josh Boyer wrote:
> On Fri, Oct 16, 2015 at 3:46 AM, David Miller <davem@davemloft.net>
> wrote:
> > From: Ben Hutchings <ben@decadent.org.uk>
> > Date: Wed, 14 Oct 2015 18:51:14 +0100
> > 
> > > 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;
> > 
> > Ben, your email client has corrupted both of these patches.
> > 
> > Please fix this up and resubmit, thanks.
> 
> Ben, did you resubmit these as David suggested?  I haven't found a v2
> anywhere.

I've just done so.

Ben.
diff mbox

Patch

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;