Re: [PATCH][next] devlink: fix memory leak on 'resource'

From: David Miller
Date: Mon Jan 22 2018 - 09:27:45 EST


From: Colin King <colin.king@xxxxxxxxxxxxx>
Date: Mon, 22 Jan 2018 10:31:19 +0000

> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
>
> 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 <colin.king@xxxxxxxxxxxxx>

Applied, thanks Colin.