Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932315AbbBTSOL (ORCPT ); Fri, 20 Feb 2015 13:14:11 -0500 Received: from mailrelay107.isp.belgacom.be ([195.238.20.134]:8657 "EHLO mailrelay107.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932193AbbBTSNK (ORCPT ); Fri, 20 Feb 2015 13:13:10 -0500 X-Belgacom-Dynamic: yes X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=pojTLeLEEG+IB9MeyQ9xnWKWJHiyH+4Hnj5iAYu/pCk= c=1 sm=2 a=JfrnYn6hAAAA:8 a=nOAMpi4SgmaIPNVEcwoA:9 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DuCwAReOdU/zwEtFtbgwaxSgUBdpdNAoEYRAEBAQEBAXyEEAEFJy8jEFE5HhmIMwHCKJJPAQEBByKGBIl5BxaEFQWZEYpsiEUigjKBPT0xgkMBAQE From: Fabian Frederick To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Peter Zijlstra , Greg Kroah-Hartman , Fabian Frederick , Jiri Slaby , linux-serial@vger.kernel.org Subject: [PATCH 7/7 linux-next] serial: core: replace current->state by __set_current_state() Date: Fri, 20 Feb 2015 19:12:57 +0100 Message-Id: <1424455977-21903-7-git-send-email-fabf@skynet.be> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1424455977-21903-1-git-send-email-fabf@skynet.be> References: <1424455977-21903-1-git-send-email-fabf@skynet.be> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1067 Lines: 33 Use helper functions to access current->state. Direct assignments are prone to races and therefore buggy. Thanks to Peter Zijlstra for the exact definition of the problem. Suggested-By: Peter Zijlstra Signed-off-by: Fabian Frederick --- drivers/tty/serial/serial_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 6a1055a..63d2947 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -1118,8 +1118,7 @@ uart_wait_modem_status(struct uart_state *state, unsigned long arg) cprev = cnow; } - - current->state = TASK_RUNNING; + __set_current_state(TASK_RUNNING); remove_wait_queue(&port->delta_msr_wait, &wait); return ret; -- 2.1.0 -- 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/