diff options
author | Alexandre Courbot <acourbot@nvidia.com> | 2016-01-25 18:44:23 +0900 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2016-03-14 10:11:06 +1000 |
commit | 0529a46a7ae038761d2860b15c8d025cec448e88 (patch) | |
tree | ca17eca60c42e29778450a931afabad2515b45c4 | |
parent | 33bcb4c340d843b5726842fce7d5ae222b125773 (diff) |
drm/nouveau/device: call nvkm_device_fini if nvkm_device_init fails
nvkm_device_fini is never called if a failure occurs in
nvkm_device_init, even when unloading the module. This can lead to a
resources leak (one example is the Tegra interrupt which would never be
freed in that case). Fix this by calling nvkm_device_fini in
nvkm_device_init's failure path.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c index b1ba1c782a2b..8ef0ae854038 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c @@ -2261,6 +2261,8 @@ fail_subdev: } while (--i >= 0); fail: + nvkm_device_fini(device, false); + nvdev_error(device, "init failed with %d\n", ret); return ret; } |