drm/i915/bios: Avoid temporary allocation whilst searching for downclock
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 13 Jul 2011 20:01:46 +0000 (21:01 +0100)
committerKeith Packard <keithp@keithp.com>
Wed, 13 Jul 2011 20:35:34 +0000 (13:35 -0700)
commit99834ea446d5c0da3f6cfa355fe4670840d45f79
treee3c8db257a2fe402477399a892c710989a1bd15f
parent95736720fc866eadb2ce1789631b907c0f38cb7c
drm/i915/bios: Avoid temporary allocation whilst searching for downclock

Alan Cox reported a missing check on the kmalloc return value for the
allocation of a temporary mode used for searching for the LVDS downlock
frequency. This allocation is roughly 200 bytes, a little too large to
friviously place on the stack. However, we can simply use the few bytes
we need stored within the original DVO timing data, skip the translation
and do the compare directly between the timing data rather than on a
mode, thus avoiding the need for any temporary allocations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
drivers/gpu/drm/i915/intel_bios.c