drm/nouveau: Use drm_connector_list_iter_* for iterating connectors
authorLyude Paul <lyude@redhat.com>
Fri, 13 Jul 2018 17:06:32 +0000 (13:06 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Jul 2018 09:25:08 +0000 (11:25 +0200)
commit22c4488c864922b19dfed41c16ebf9568f78743b
treeb5ec55a912147532cc56a89d83b64c99f8765afd
parent387362c3ed80bd266ab8cfdf971311044adbd478
drm/nouveau: Use drm_connector_list_iter_* for iterating connectors

commit 22b76bbe089cd901f5260ecb9a3dc41f9edb97a0 upstream.

Every codepath in nouveau that loops through the connector list
currently does so using the old method, which is prone to race
conditions from MST connectors being created and destroyed. This has
been causing a multitude of problems, including memory corruption from
trying to access connectors that have already been freed!

Signed-off-by: Lyude Paul <lyude@redhat.com>
Cc: stable@vger.kernel.org
Cc: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/nouveau/nouveau_backlight.c
drivers/gpu/drm/nouveau/nouveau_connector.c
drivers/gpu/drm/nouveau/nouveau_connector.h
drivers/gpu/drm/nouveau/nouveau_display.c