Skip to content

Commit 6532379

Browse files
Dan Carpenterdakr
authored andcommitted
drm/nouveau/mmu/r535: uninitialized variable in r535_bar_new_()
If gf100_bar_new_() fails then "bar" is not initialized. Fixes: 5bf0257 ("drm/nouveau/mmu/r535: initial support") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Danilo Krummrich <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 0affdba commit 6532379

File tree

1 file changed

+2
-3
lines changed
  • drivers/gpu/drm/nouveau/nvkm/subdev/bar

1 file changed

+2
-3
lines changed

drivers/gpu/drm/nouveau/nvkm/subdev/bar/r535.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,11 @@ r535_bar_new_(const struct nvkm_bar_func *hw, struct nvkm_device *device,
168168
rm->flush = r535_bar_flush;
169169

170170
ret = gf100_bar_new_(rm, device, type, inst, &bar);
171-
*pbar = bar;
172171
if (ret) {
173-
if (!bar)
174-
kfree(rm);
172+
kfree(rm);
175173
return ret;
176174
}
175+
*pbar = bar;
177176

178177
bar->flushBAR2PhysMode = ioremap(device->func->resource_addr(device, 3), PAGE_SIZE);
179178
if (!bar->flushBAR2PhysMode)

0 commit comments

Comments
 (0)