[Nouveau] [PATCH] device: call nvkm_device_fini if nvkm_device_init fails
Alexandre Courbot
gnurou at gmail.com
Mon Jan 25 16:01:23 PST 2016
On Tue, Jan 26, 2016 at 12:17 AM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> Should these get back-ported to any released kernels?
Probably ok not to, I found these while testing the error paths for secure boot.
>
> On Mon, Jan 25, 2016 at 4:44 AM, Alexandre Courbot <acourbot at nvidia.com> wrote:
>> 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 at nvidia.com>
>> ---
>> drm/nouveau/nvkm/engine/device/base.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drm/nouveau/nvkm/engine/device/base.c b/drm/nouveau/nvkm/engine/device/base.c
>> index b1ba1c782a2b..8ef0ae854038 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;
>> }
>> --
>> 2.7.0
>>
>> _______________________________________________
>> Nouveau mailing list
>> Nouveau at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/nouveau
> _______________________________________________
> Nouveau mailing list
> Nouveau at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/nouveau
More information about the Nouveau
mailing list