RE: [PATCH net-next] netdevsim: dev: Fix memory leak in nsim_dev_take_snapshot_write

From: Keller, Jacob E
Date: Tue Mar 31 2020 - 12:59:07 EST




> -----Original Message-----
> From: Gustavo A. R. Silva <gustavo@xxxxxxxxxxxxxx>
> Sent: Monday, March 30, 2020 4:27 PM
> To: Jakub Kicinski <kuba@xxxxxxxxxx>; David S. Miller <davem@xxxxxxxxxxxxx>;
> Keller, Jacob E <jacob.e.keller@xxxxxxxxx>; Jiri Pirko <jiri@xxxxxxxxxxxx>
> Cc: netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Gustavo A. R. Silva
> <gustavo@xxxxxxxxxxxxxx>
> Subject: [PATCH net-next] netdevsim: dev: Fix memory leak in
> nsim_dev_take_snapshot_write
>
> In case memory resources for dummy_data were allocated, release them
> before return.
>
> Addresses-Coverity-ID: 1491997 ("Resource leak")
> Fixes: 7ef19d3b1d5e ("devlink: report error once U32_MAX snapshot ids have
> been used")
> Signed-off-by: Gustavo A. R. Silva <gustavo@xxxxxxxxxxxxxx>
> ---

Ahh! Thanks!

Belated Reviewed-by: Jacob Keller <jacob.e.keller@xxxxxxxxx>