drm/nouveau: fix handling empty channel list in ioctl's
authorMaarten Lankhorst <maarten.lankhorst@canonical.com>
Sun, 24 Mar 2013 14:36:38 +0000 (15:36 +0100)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 29 Mar 2013 03:44:57 +0000 (13:44 +1000)
commitb43decd2c513ae44a5462a1a4c2622f0fa77c9e0
treead0418ad04e067e4c8400735ec281523840963fd
parentf60b6e7a6078ceae438a95b808be04cd98f9909a
drm/nouveau: fix handling empty channel list in ioctl's

If there are no channels, chan would never end up being NULL,
and so the null pointer check would fail.

Solve this by initializing chan to NULL, and iterating over temp instead.

Fixes oops when running intel-gpu-tools/tests/kms_flip, which attempts to
do some intel ioctl's on a nouveau device.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: stable@vger.kernel.org [3.7+]
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_abi16.c