From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH][next] devlink: fix memory leak on 'resource' Date: Mon, 22 Jan 2018 09:27:37 -0500 (EST) Message-ID: <20180122.092737.278179232055886032.davem@davemloft.net> References: <20180122103119.4801-1-colin.king@canonical.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: arkadis@mellanox.com, jiri@mellanox.com, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org To: colin.king@canonical.com Return-path: In-Reply-To: <20180122103119.4801-1-colin.king@canonical.com> Sender: kernel-janitors-owner@vger.kernel.org List-Id: netdev.vger.kernel.org From: Colin King Date: Mon, 22 Jan 2018 10:31:19 +0000 > From: Colin Ian King > > Currently, if the call to devlink_resource_find returns null then > the error exit path does not free the devlink_resource 'resource' > and a memory leak occurs. Fix this by kfree'ing resource on the > error exit path. > > Detected by CoverityScan, CID#1464184 ("Resource leak") > > Fixes: d9f9b9a4d05f ("devlink: Add support for resource abstraction") > Signed-off-by: Colin Ian King Applied, thanks Colin.