Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754104Ab3IQW3e (ORCPT ); Tue, 17 Sep 2013 18:29:34 -0400 Received: from mail-ie0-f171.google.com ([209.85.223.171]:38086 "EHLO mail-ie0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753007Ab3IQW3c (ORCPT ); Tue, 17 Sep 2013 18:29:32 -0400 MIME-Version: 1.0 From: John Tapsell Date: Tue, 17 Sep 2013 23:29:11 +0100 Message-ID: Subject: [PATCH] fbcon: fix deadlock in fbcon_generic_blank() To: Jean-Christophe Plagniol-Villard , Tomi Valkeinen Cc: Peter Hurley , Dave Airlie , linux-fbdev@vger.kernel.org, linux-kernel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1384 Lines: 43 Do not lock fb_info when calling sending the FB_EVENT_CONBLANK event. In fbmem.c, the semantics are that we acquire the lock_fb_info first, and then console_lock. However when fbcon.c fbcon_generic_blank() is called, the console lock could already be held. Locking fb_info can thus cause a deadlock. fbmem.c sends the FB_EVENT_BLANK without locking lock_fb_info first, so this change introduces similar behaviour. Signed-off-by: John Tapsell --- drivers/video/console/fbcon.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 6b4fb5c..8546441 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -2333,13 +2333,9 @@ static void fbcon_generic_blank(struct vc_data *vc, struct fb_info *info, vc->vc_video_erase_char = oldc; } - - if (!lock_fb_info(info)) - return; event.info = info; event.data = ␣ fb_notifier_call_chain(FB_EVENT_CONBLANK, &event); - unlock_fb_info(info); } static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) -- 1.8.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/