public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn•ch>
To: Colin King <colin.king@canonical•com>
Cc: Vivien Didelot <vivien.didelot@gmail•com>,
	Florian Fainelli <f.fainelli@gmail•com>,
	"David S . Miller" <davem@davemloft•net>,
	Jakub Kicinski <jakub.kicinski@netronome•com>,
	netdev@vger•kernel.org, kernel-janitors@vger•kernel.org,
	linux-kernel@vger•kernel.org
Subject: Re: [PATCH][next] net: dsa: fix dereference on ds->dev before null check error
Date: Thu, 24 Oct 2019 13:58:31 +0200	[thread overview]
Message-ID: <20191024115831.GA12631@lunn.ch> (raw)
In-Reply-To: <20191024103218.2592-1-colin.king@canonical.com>

On Thu, Oct 24, 2019 at 11:32:18AM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical•com>
> 
> Currently ds->dev is dereferenced on the assignments of pdata and
> np before ds->dev is null checked, hence there is a potential null
> pointer dereference on ds->dev.  Fix this by assigning pdata and
> np after the ds->dev null pointer sanity check.
> 
> Addresses-Coverity: ("Dereference before null check")
> Fixes: 7e99e3470172 ("net: dsa: remove dsa_switch_alloc helper")
> Signed-off-by: Colin Ian King <colin.king@canonical•com>

Reviewed-by: Andrew Lunn <andrew@lunn•ch>

    Andrew

  reply	other threads:[~2019-10-24 11:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-24 10:32 [PATCH][next] net: dsa: fix dereference on ds->dev before null check error Colin King
2019-10-24 11:58 ` Andrew Lunn [this message]
2019-10-24 16:39 ` Florian Fainelli
2019-10-24 16:47 ` Vivien Didelot

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=20191024115831.GA12631@lunn.ch \
    --to=andrew@lunn$(echo .)ch \
    --cc=colin.king@canonical$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=f.fainelli@gmail$(echo .)com \
    --cc=jakub.kicinski@netronome$(echo .)com \
    --cc=kernel-janitors@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=vivien.didelot@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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