From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH][next] devlink: fix memory leak on 'resource' Date: Mon, 22 Jan 2018 11:34:12 +0100 Message-ID: <20180122103412.GB2012@nanopsycho> References: <20180122103119.4801-1-colin.king@canonical.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Arkadi Sharshevsky , Jiri Pirko , "David S . Miller" , netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org To: Colin King Return-path: Content-Disposition: inline In-Reply-To: <20180122103119.4801-1-colin.king@canonical.com> Sender: kernel-janitors-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Mon, Jan 22, 2018 at 11:31:19AM CET, colin.king@canonical.com wrote: >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 Acked-by: Jiri Pirko Thanks.