netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Kangjie Lu <kjlu@umn.edu>
Cc: pakki001@umn.edu, Kalle Valo <kvalo@codeaurora.org>,
	"David S. Miller" <davem@davemloft.net>,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: iwlegacy: fix potential NULL pointer dereferences
Date: Mon, 11 Mar 2019 10:16:08 +0100	[thread overview]
Message-ID: <20190311091607.GC3310@redhat.com> (raw)
In-Reply-To: <20190311073758.31038-1-kjlu@umn.edu>

On Mon, Mar 11, 2019 at 02:37:57AM -0500, Kangjie Lu wrote:
> In case create_singlethread_workqueue fails, the fix immediately
> return to avoid NULL pointer dereferences.
> 
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
> ---
>  drivers/net/wireless/intel/iwlegacy/3945-mac.c | 2 ++
>  drivers/net/wireless/intel/iwlegacy/4965-mac.c | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/drivers/net/wireless/intel/iwlegacy/3945-mac.c b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
> index 271977f7fbb0..d23ee2ca0c8e 100644
> --- a/drivers/net/wireless/intel/iwlegacy/3945-mac.c
> +++ b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
> @@ -3403,6 +3403,8 @@ static void
>  il3945_setup_deferred_work(struct il_priv *il)
>  {
>  	il->workqueue = create_singlethread_workqueue(DRV_NAME);
> +	if (!il->workqueue)
> +		return;

This is not full fix since we will crash later without setup various
structures in il3945_setup_deferred_work. The driver is pretty
much legacy and worked for decade (or maybe more) without NULL
dereference of il->workqueue. I do not see need to fix _potential_
problems as fix can introduce more harm than good.

Stanislaw 

      reply	other threads:[~2019-03-11  9:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-11  7:37 [PATCH] net: iwlegacy: fix potential NULL pointer dereferences Kangjie Lu
2019-03-11  9:16 ` Stanislaw Gruszka [this message]

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=20190311091607.GC3310@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=davem@davemloft.net \
    --cc=kjlu@umn.edu \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pakki001@umn.edu \
    /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;
as well as URLs for NNTP newsgroup(s).