net: devlink: Fix missing mutex_unlock() call
authorAmmar Faizi <ammarfaizi2@gnuweeb.org>
Mon, 1 Aug 2022 11:59:56 +0000 (18:59 +0700)
committerJakub Kicinski <kuba@kernel.org>
Mon, 1 Aug 2022 19:47:10 +0000 (12:47 -0700)
commit80ef928643c1558a0474389fcd680a5ccd6c86e6
tree0878d6785164668d3a5db1fa05d1aa0efed505f9
parentd81c7cdd7a6ddffcc8c00c991e3d6e24db84bd9e
net: devlink: Fix missing mutex_unlock() call

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@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 2dec18ad826f ("net: devlink: remove region snapshots list dependency on devlink->lock")
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20220801115742.1309329-1-ammar.faizi@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/devlink.c