From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46FF7C433F5 for ; Tue, 17 May 2022 11:08:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344906AbiEQLID (ORCPT ); Tue, 17 May 2022 07:08:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236977AbiEQLIB (ORCPT ); Tue, 17 May 2022 07:08:01 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9785160FB; Tue, 17 May 2022 04:08:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652785680; x=1684321680; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9slmVJB08S/xmRyUkvYJ6Tki39bkbQlupsPD2XkQ7Yw=; b=eRu7G9ZxwX1L6nmx4cGlZGuOtlkKKr4jdsq3Q1+O4CbVsbi2nTmt0eXU iNf9A5d++xFaSHl8zeLOvfQCRxqS/7Ju/r/jPIyns84105AqnTxfYGGbP cw+1zYzTLKcIdclSb+R7G7hALsFFNXZEEL7Lg8wQ+MEpYKwN2mOIgXfE5 8Ue9BIzG5Y5NTGS8k1ujPOg0DEZzZ7HNWvphj+GXLEWCa8q3eWE1+YyWu Jbk/79x1/vI+eil8x0O3rRwqPEMZpWvlIqvW2781lqwOfjbxL3sryp8Gu 0AMjFlyUY4cg+2K02SC77eL2Bc4XVdz7NTN1NBx0Ei3IEJDu76PjUEjHi w==; X-IronPort-AV: E=McAfee;i="6400,9594,10349"; a="271268670" X-IronPort-AV: E=Sophos;i="5.91,232,1647327600"; d="scan'208";a="271268670" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 04:08:00 -0700 X-IronPort-AV: E=Sophos;i="5.91,232,1647327600"; d="scan'208";a="568830955" Received: from mtarral-mobl.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.52.88]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 04:07:58 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg KH , Jiri Slaby , Baruch Siach , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH 2/9] serial: digicolor-usart: Don't allow CS5-6 Date: Tue, 17 May 2022 14:07:30 +0300 Message-Id: <20220517110737.37148-3-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220517110737.37148-1-ilpo.jarvinen@linux.intel.com> References: <20220517110737.37148-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Only CS7 and CS8 seem supported but CSIZE is not sanitized to CS8 in the default: block. Set CSIZE correctly so that userspace knows the effective value. Incorrect CSIZE also results in miscalculation of the frame bits in tty_get_char_size() or in its predecessor where the roughly the same code is directly within uart_update_timeout(). Cc: Baruch Siach Fixes: 5930cb3511df (serial: driver for Conexant Digicolor USART) Signed-off-by: Ilpo Järvinen --- drivers/tty/serial/digicolor-usart.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/tty/serial/digicolor-usart.c b/drivers/tty/serial/digicolor-usart.c index 6d70fea76bb3..65e653eb5026 100644 --- a/drivers/tty/serial/digicolor-usart.c +++ b/drivers/tty/serial/digicolor-usart.c @@ -309,6 +309,8 @@ static void digicolor_uart_set_termios(struct uart_port *port, case CS8: default: config |= UA_CONFIG_CHAR_LEN; + termios->c_cflag &= ~CSIZE; + termios->c_cflag |= CS8; break; } -- 2.30.2