Commit 65323796 authored by Dan Carpenter's avatar Dan Carpenter Committed by Danilo Krummrich

drm/nouveau/mmu/r535: uninitialized variable in r535_bar_new_()

If gf100_bar_new_() fails then "bar" is not initialized.

Fixes: 5bf02571 ("drm/nouveau/mmu/r535: initial support")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarDanilo Krummrich <dakr@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/dab21df7-4d90-4479-97d8-97e5d228c714@moroto.mountain
parent 0affdba2
...@@ -168,12 +168,11 @@ r535_bar_new_(const struct nvkm_bar_func *hw, struct nvkm_device *device, ...@@ -168,12 +168,11 @@ r535_bar_new_(const struct nvkm_bar_func *hw, struct nvkm_device *device,
rm->flush = r535_bar_flush; rm->flush = r535_bar_flush;
ret = gf100_bar_new_(rm, device, type, inst, &bar); ret = gf100_bar_new_(rm, device, type, inst, &bar);
*pbar = bar;
if (ret) { if (ret) {
if (!bar) kfree(rm);
kfree(rm);
return ret; return ret;
} }
*pbar = bar;
bar->flushBAR2PhysMode = ioremap(device->func->resource_addr(device, 3), PAGE_SIZE); bar->flushBAR2PhysMode = ioremap(device->func->resource_addr(device, 3), PAGE_SIZE);
if (!bar->flushBAR2PhysMode) if (!bar->flushBAR2PhysMode)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment