public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Geoff Levand <geoff@infradead.org>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, cbe-oss-dev@lists.ozlabs.org,
	linux-kernel@vger.kernel.org,
	Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Subject: Re: [PATCH] net: ethernet: toshiba: ps3_gelic_net.c:  Cleaning up a check on a memory allocation
Date: Mon, 09 Jun 2014 16:21:10 -0700	[thread overview]
Message-ID: <1402356070.9238.69.camel@smoke> (raw)
In-Reply-To: <1402136528-16857-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Hi,

On Sat, 2014-06-07 at 12:22 +0200, Rickard Strandqvist wrote:
> A check on a memory allocation is checked incorrectly.
> 
> This was partly found using a static code analysis program called cppcheck.
> 
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  drivers/net/ethernet/toshiba/ps3_gelic_net.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_net.c b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
> index d899d00..bb79928 100644
> --- a/drivers/net/ethernet/toshiba/ps3_gelic_net.c
> +++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
> @@ -1561,7 +1561,7 @@ static struct gelic_card *gelic_alloc_card_net(struct net_device **netdev)
>  	 * alloc netdev
>  	 */
>  	*netdev = alloc_etherdev(sizeof(struct gelic_port));
> -	if (!netdev) {
> +	if (!*netdev) {
>  		kfree(card->unalign);
>  		return NULL;
>  	}

Looks good, thanks for posting.

Dave, please queue for merge upstream.

Acked-by: Geoff Levand <geoff@infradead.org>

  reply	other threads:[~2014-06-09 23:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-07 10:22 [PATCH] net: ethernet: toshiba: ps3_gelic_net.c: Cleaning up a check on a memory allocation Rickard Strandqvist
2014-06-09 23:21 ` Geoff Levand [this message]
2014-06-11  7:15 ` David Miller

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=1402356070.9238.69.camel@smoke \
    --to=geoff@infradead.org \
    --cc=cbe-oss-dev@lists.ozlabs.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rickard_strandqvist@spectrumdigital.se \
    /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