Skip to content

Commit

Permalink
drm/nouveau/gr/gf100: Fix missing unlock in gf100_gr_chan_new()
Browse files Browse the repository at this point in the history
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: ca081ff ("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
  • Loading branch information
Li Huafei authored and Lyude Paul committed Oct 29, 2024
1 parent 973db93 commit a2f5990
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit a2f5990

Please sign in to comment.