backlight: grab ops_lock before testing bd->ops
commit7e8d53c0fad544ddb5f62bb6faf836ec04256608
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 24 Nov 2010 20:57:14 +0000 (24 12:57 -0800)
committerAndi Kleen <ak@linux.intel.com>
Tue, 14 Dec 2010 22:40:14 +0000 (14 23:40 +0100)
treed76cb504fd28fd88ad87e8f5162992b18f05ac60
parent77caa21878730e393b25868930dbddf686e77f33
backlight: grab ops_lock before testing bd->ops

commit d1d73578e053b981c3611e5a211534290d24a5eb upstream.

According to the comment describing ops_lock in the definition of struct
backlight_device and when comparing with other functions in backlight.c
the mutex must be hold when checking ops to be non-NULL.

Fixes a problem added by c835ee7f4154992e6 ("backlight: Add suspend/resume
support to the backlight core") in Jan 2009.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Richard Purdie <rpurdie@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
drivers/video/backlight/backlight.c