lkml.org 
[lkml]   [2019]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] net: liquidio: fix NULL pointer dereferences
From
Date


> On Mar 11, 2019, at 2:17 PM, David Miller <davem@davemloft.net> wrote:
>
> 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.

I was referring to how the following code handles errors.
Does that mean that the returns at line 2004, 2012, and 2019 are also leaking
devices?

>

\
 
 \ /
  Last update: 2019-03-12 06:27    [W:0.664 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site