diff options
author | Alexandre Courbot <acourbot@nvidia.com> | 2016-01-25 18:44:23 +0900 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2016-02-25 13:22:09 +1000 |
commit | a12523d997bb2f5be68514e2b91148d6c3cb3eae (patch) | |
tree | a5d076920d2dc59f8fb3026d99fcbf98a384bc41 | |
parent | 8e312b9d42ff3d5f7dba2357b0a853c55604d14c (diff) | |
download | nouveau-a12523d997bb2f5be68514e2b91148d6c3cb3eae.tar.gz |
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-- | drm/nouveau/nvkm/engine/device/base.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drm/nouveau/nvkm/engine/device/base.c b/drm/nouveau/nvkm/engine/device/base.c index b1ba1c782..8ef0ae854 100644 --- a/drm/nouveau/nvkm/engine/device/base.c +++ b/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; } |