linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: kjlu@umn.edu
Cc: pakki001@umn.edu, dchickles@marvell.com, sburla@marvell.com,
	fmanlunas@marvell.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: liquidio: fix NULL pointer dereferences
Date: Mon, 11 Mar 2019 12:17:10 -0700 (PDT)	[thread overview]
Message-ID: <20190311.121710.968693621648443243.davem@davemloft.net> (raw)
In-Reply-To: <20190311054615.11760-1-kjlu@umn.edu>

From: Kangjie Lu <kjlu@umn.edu>
Date: Mon, 11 Mar 2019 00:46:15 -0500

> @@ -1960,6 +1966,12 @@ static int setup_nic_devices(struct octeon_device *octeon_dev)
>  		sc = (struct octeon_soft_command *)
>  			octeon_alloc_soft_command(octeon_dev, data_size,
>  						  resp_size, 0);
> +		if (!sc) {
> +			dev_err(&octeon_dev->pci_dev->dev,
> +				"Failed to allocate octeon_soft_command\n");
> +			return -ENOMEM;
> +		}

Again, very sloppy.  You have to branch to setup_nic_dev_free in this situation
otherwise you leak devices allocated and setup from previous iterations of the
loop this code is in.


  reply	other threads:[~2019-03-11 19:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-11  5:46 [PATCH] net: liquidio: fix NULL pointer dereferences Kangjie Lu
2019-03-11 19:17 ` David Miller [this message]
2019-03-12  5:26   ` Kangjie Lu
2019-03-23  3:24   ` [PATCH v2] " Kangjie Lu
2019-03-25 12:41     ` Ulf Hansson
2019-03-26  0:14     ` 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=20190311.121710.968693621648443243.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=dchickles@marvell.com \
    --cc=fmanlunas@marvell.com \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pakki001@umn.edu \
    --cc=sburla@marvell.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;
as well as URLs for NNTP newsgroup(s).