Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp33321iob; Tue, 17 May 2022 17:53:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYPMOYKplYADEt3kIgSXMeAcHlci8MqIp6cdH7hBHTGZyVwQNUvk77TcguQ45S+aDhjshT X-Received: by 2002:aa7:8892:0:b0:50e:1463:3cd1 with SMTP id z18-20020aa78892000000b0050e14633cd1mr24461770pfe.13.1652835187349; Tue, 17 May 2022 17:53:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652835187; cv=none; d=google.com; s=arc-20160816; b=rzSKV8Jhf9Q3bxfPyHOzXkiYR6La3IwRi2miL2jbH117qXHWru2tm9DJ2qbjUtVCz7 XWyznDHtZKA0yZw+0tpoP80iG2BG4lw7/HydFrMH5hxv6AU6b4QMNCB/oSSOKdxaVuhn 2XmONb9+yvakRTuWhyHs2NWk+bpftOeeOZwSbeOLUU22gxj8H8zwzbzNQoRYvMJlnwuI XPKeGxLmBO/P4/RZCbc9FrxH/N27YreEygTW4Utd23expnIr9V0RIE20o5bTjhODKITR Le9s6NboGa0GLIR4MDCcDmmjQ+WKU/KqCJTu5MJZ2/nIE2HbrwNAnqRqt61jgWWc4ujl L/lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OY1AnO8Enz3YkYEqZmQjbfG0AUAjGLbRwnOJQqvwxRQ=; b=ar/5dnwA8VlI5dTcFqEtmVbMKb8O20PZ13WaGQoyh7O1MUKYNFspW2sEarETo+g7U4 jyJaRQp7JDWXkgBrdonBSbqfDgl0q5eF6sQm2b3LAj0rTVs+vCyB7iei5T2qPvh8CCqO y6lWoDRXBKFg/+FdWYsPzV0sYW2Bn4od/i6cAZCssaPYmNvGHDo9M3DbsvpkrnKZZ6Aa UyEYoRqe9Ff6tQhcv47BdTxmCcV1kM2zfUNtFEZKtx76ZosrSyKJMkctkylN593gLTYM Lc2kHY9kRpDOkd3TYoXkbUQiWC9oCyHuDDN9sXxLF8k4I8amjOEnO2ET/sG/lQ906Pxt IjoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eRu7G9Zx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nl3-20020a17090b384300b001cac1e802d5si994785pjb.82.2022.05.17.17.52.31; Tue, 17 May 2022 17:53:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eRu7G9Zx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344922AbiEQLIJ (ORCPT + 99 others); Tue, 17 May 2022 07:08:09 -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 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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