]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/nouveau/gr/gf100: Fix missing unlock in gf100_gr_chan_new()
authorLi Huafei <lihuafei1@huawei.com>
Sat, 26 Oct 2024 17:38:44 +0000 (01:38 +0800)
committerLyude Paul <lyude@redhat.com>
Tue, 29 Oct 2024 19:48:56 +0000 (15:48 -0400)
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: ca081fff6ecc ("drm/nouveau/gr/gf100-: generate golden context during first object alloc")
Signed-off-by: Li Huafei <lihuafei1@huawei.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241026173844.2392679-1-lihuafei1@huawei.com
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c

index 060c74a80eb14b916db3c441e44b137dd15b7336..3ea447f6a45b51b9097ee26e506b36b5d57c89ba 100644 (file)
@@ -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;
                }
        }