public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Colin King <colin.king@canonical.com>
Cc: Andreas Noever <andreas.noever@gmail.com>,
	Michael Jamet <michael.jamet@intel.com>,
	Yehezkel Bernat <YehezkelShB@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rajmohan Mani <rajmohan.mani@intel.com>,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] thunderbolt: fix memory leak of object sw
Date: Mon, 23 Dec 2019 12:13:17 +0200	[thread overview]
Message-ID: <20191223101317.GF2628@lahna.fi.intel.com> (raw)
In-Reply-To: <20191220220526.11307-1-colin.king@canonical.com>

On Fri, Dec 20, 2019 at 10:05:26PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> In the case where the call tb_switch_exceeds_max_depth is true
> the error reurn path leaks memory in sw.  Fix this by setting
> the return error code to -EADDRNOTAVAIL and returning via the
> error exit path err_free_sw_ports to free sw. sw has been kzalloc'd
> so the free of the NULL sw->ports is fine.
>
> Addresses-Coverity: ("Resource leak")
> Fixes: b04079837b20 ("thunderbolt: Add initial support for USB4")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Greg, can you take this to your usb-next branch where the rest of the
USB4 stuff is?

Thanks!

  reply	other threads:[~2019-12-23 10:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-20 22:05 [PATCH][next] thunderbolt: fix memory leak of object sw Colin King
2019-12-23 10:13 ` Mika Westerberg [this message]
2019-12-23 11:52   ` Greg Kroah-Hartman

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=20191223101317.GF2628@lahna.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=colin.king@canonical.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.jamet@intel.com \
    --cc=rajmohan.mani@intel.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