Content-Type: multipart/mixed; boundary="===============4475910453144694066==" MIME-Version: 1.0 From: Ammar Faizi To: kbuild-all@lists.01.org Subject: [PATCH] net: devlink: Fix missing mutex_unlock() call Date: Mon, 01 Aug 2022 18:59:56 +0700 Message-ID: <20220801115742.1309329-1-ammar.faizi@intel.com> In-Reply-To: <202207311503.QBFSGqiL-lkp@intel.com> List-Id: --===============4475910453144694066== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Ammar Faizi 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 '®ion->snapshot_lock'. Make sure we call mutex_unlock() in this error path. Reported-by: kernel test robot Reported-by: Dan Carpenter Fixes: 2dec18ad826f52658f7781ee995d236cc449b678 ("net: devlink: remove regi= on snapshots list dependency on devlink->lock") Signed-off-by: Ammar Faizi --- net/core/devlink.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/core/devlink.c b/net/core/devlink.c index 889e7e3d3e8a..5da5c7cca98a 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -6315,8 +6315,10 @@ devlink_nl_cmd_region_new(struct sk_buff *skb, struc= t genl_info *info) = snapshot =3D devlink_region_snapshot_get_by_id(region, snapshot_id); - if (WARN_ON(!snapshot)) - return -EINVAL; + if (WARN_ON(!snapshot)) { + err =3D -EINVAL; + goto unlock; + } = msg =3D devlink_nl_region_notify_build(region, snapshot, DEVLINK_CMD_REGION_NEW, base-commit: 0a324c3263f1e456f54dd8dc8ce58575aea776bc -- = Ammar Faizi --===============4475910453144694066==--