drm/nouveau: Fix runtime PM leak in drm_open()
authorLyude Paul <lyude@redhat.com>
Thu, 12 Jul 2018 17:02:52 +0000 (13:02 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2018 06:38:11 +0000 (08:38 +0200)
commit96ff197fab41164f4b8e41710dca73717d6333ac
tree9108a914c51b23a4101b11670a2a51a0734abd78
parent636a9a7d52219fcf4364044a71947e3eebc2ac10
drm/nouveau: Fix runtime PM leak in drm_open()

[ Upstream commit 922a8c82fafdec99688bbaea6c5889f562a42cdc ]

Noticed this as I was skimming through, if we fail to allocate memory
for cli we'll end up returning without dropping the runtime PM ref we
got. Additionally, we'll even return the wrong return code! (ret most
likely will == 0 here, we want -ENOMEM).

Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/nouveau/nouveau_drm.c