Re: [PATCH] net: devlink: Fix missing mutex_unlock() call

From: Jiri Pirko
Date: Mon Aug 01 2022 - 10:41:19 EST


Mon, Aug 01, 2022 at 01:59:56PM CEST, ammarfaizi2@xxxxxxxxxxx wrote:
>From: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx>
>
>Commit 2dec18ad826f forgets to call mutex_unlock() before the function
>returns in the error path:
>
> New smatch warnings:
> net/core/devlink.c:6392 devlink_nl_cmd_region_new() warn: inconsistent \
> returns '&region->snapshot_lock'.
>
>Make sure we call mutex_unlock() in this error path.
>
>Reported-by: kernel test robot <lkp@xxxxxxxxx>
>Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
>Fixes: 2dec18ad826f52658f7781ee995d236cc449b678 ("net: devlink: remove region snapshots list dependency on devlink->lock")
>Signed-off-by: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx>

Reviewed-by: Jiri Pirko <jiri@xxxxxxxxxx>

Thanks for the fix!