Commit 1ce2b4ed authored by Li Huafei's avatar Li Huafei Committed by Ye Bin
Browse files

drm/nouveau/gr/gf100: Fix missing unlock in gf100_gr_chan_new()

stable inclusion
from stable-v6.6.64
commit 237f2dbfa00576bb1aa8dc2dce403c64e53270e6
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBEGFJ
CVE: CVE-2024-56752

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=237f2dbfa00576bb1aa8dc2dce403c64e53270e6



--------------------------------

[ Upstream commit a2f599046c671d6b46d93aed95b37241ce4504cf ]

When the call to gf100_grctx_generate() fails, unlock gr->fecs.mutex
before returning the error.

Fixes smatch warning:

drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c:480 gf100_gr_chan_new() warn: inconsistent returns '&gr->fecs.mutex'.

Fixes: ca081fff ("drm/nouveau/gr/gf100-: generate golden context during first object alloc")
Signed-off-by: default avatarLi Huafei <lihuafei1@huawei.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241026173844.2392679-1-lihuafei1@huawei.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYe Bin <yebin10@huawei.com>
parent 1e531b83
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -443,6 +443,7 @@ gf100_gr_chan_new(struct nvkm_gr *base, struct nvkm_chan *fifoch,
		ret = gf100_grctx_generate(gr, chan, fifoch->inst);
		if (ret) {
			nvkm_error(&base->engine.subdev, "failed to construct context\n");
			mutex_unlock(&gr->fecs.mutex);
			return ret;
		}
	}