i915: intel_set_mode: Reduce stack allocation from 500 bytes to 2 pointers
authorTim Gardner <tim.gardner@canonical.com>
Fri, 7 Dec 2012 14:54:26 +0000 (07:54 -0700)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 10 Dec 2012 09:13:35 +0000 (10:13 +0100)
commit3ac18232946aacf0a9807c3143f8449ed4aa68f4
treee84d135a791f856002505e6ac039a28db42c64a4
parent378a6a77ae59d3312627b996ded94e23166d9e63
i915: intel_set_mode: Reduce stack allocation from 500 bytes to 2 pointers

smatch warning:

drivers/gpu/drm/i915/intel_display.c:7019 intel_set_mode() warn: function puts
500 bytes on stack

Refactor so that saved_mode and saved_hwmode are dynamically allocated as opposed
to being automatic variables. 500 bytes seems like it could run the potential for blowing
the kernel stack.

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c