mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Jiri Slaby <jslaby@suse.cz>
Cc: YueHaibing <yuehaibing@huawei.com>,
	gregkh@linuxfoundation.org, jikos@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 -next] tty: ipwireless: Fix potential NULL pointer dereference
Date: Thu, 31 Jan 2019 13:32:53 +0100	[thread overview]
Message-ID: <20190131123253.GC2900@suse.cz> (raw)
In-Reply-To: <3813e1a8-7a54-9df0-4464-c463d7fa0b63@suse.cz>

On Wed, Jan 30, 2019 at 04:58:30PM +0100, Jiri Slaby wrote:
> On 30. 01. 19, 11:30, YueHaibing wrote:
> > There is a potential NULL pointer dereference in case
> > alloc_ctrl_packet() fails and returns NULL.
> > 
> > Fixes: 099dc4fb6265 ("ipwireless: driver for PC Card 3G/UMTS modem")
> > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> > ---
> > v2: fix return value
> > ---
> >  drivers/tty/ipwireless/hardware.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/tty/ipwireless/hardware.c b/drivers/tty/ipwireless/hardware.c
> > index b0baa4c..1e21ae3 100644
> > --- a/drivers/tty/ipwireless/hardware.c
> > +++ b/drivers/tty/ipwireless/hardware.c
> > @@ -1516,6 +1516,8 @@ static void ipw_send_setup_packet(struct ipw_hardware *hw)
> >  			sizeof(struct ipw_setup_get_version_query_packet),
> >  			ADDR_SETUP_PROT, TL_PROTOCOLID_SETUP,
> >  			TL_SETUP_SIGNO_GET_VERSION_QRY);
> > +	if (!ver_packet)
> > +		return;
> 
> LGTM, the timer will retry 30 times, ticking every second.

This should be mentioned in the changelog though, it's not obvious at
all why just returning after a failure is ok and that the packet will be
resent.

  reply	other threads:[~2019-01-31 12:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-30 10:30 YueHaibing
2019-01-30 15:58 ` Jiri Slaby
2019-01-31 12:32   ` David Sterba [this message]
2019-01-31 12:34     ` Jiri Slaby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190131123253.GC2900@suse.cz \
    --to=dsterba@suse.cz \
    --cc=gregkh@linuxfoundation.org \
    --cc=jikos@kernel.org \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®