[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190311.121710.968693621648443243.davem@davemloft.net>
Date: Mon, 11 Mar 2019 12:17:10 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: kjlu@....edu
Cc: pakki001@....edu, dchickles@...vell.com, sburla@...vell.com,
fmanlunas@...vell.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: liquidio: fix NULL pointer dereferences
From: Kangjie Lu <kjlu@....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.
Powered by blists - more mailing lists