Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp2842559pxb; Mon, 6 Sep 2021 06:37:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKkUqtv/Xwoe5NohtTlJpfIq9wmAvYnrEapjfYf80tBmnpsLiZlfvvHd7Sf2qhgOudRKSI X-Received: by 2002:a92:db06:: with SMTP id b6mr8237197iln.305.1630935463550; Mon, 06 Sep 2021 06:37:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630935463; cv=none; d=google.com; s=arc-20160816; b=GNR7LD3STZeRiGLxjMsBdKmsC5e433R5Ghf73U3HErQHPUh2+Pn+/gRRoKdJeRg+il pv2OcT5/4kSjhCc9WptjS3LiKzinSrH/SuOo+W255qZ3X0nfBhZKOFU3Ps2ih437OrG6 1kHPJ+g4VxIiumlZ5177+5Ja4vCTcDlgx+F3HuE4EVqQVpihi4V6HEPW3F8p4BLyESz7 ftH/gDsAypHkQAR/Hqx5ZOMek/CrSwEtdbxjI+riDgZemrREk4yiSFqltY3TNWlAAJCh lHVFvz8ScZ+hk73RPBRXFPYEhVqiKJJIekVOtNa9Rsv7TepktEprgh2/npyDNe7E2CNV qdoA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RcvJAZT6tfU7shkvsVpY4GX+Ii2/SyYzidRSrWFGNLY=; b=Q9YAXqcFHB4VmkE+IJK9koHYq+Rlwb/DpMsymUzzx2qMXg3YBVQqq49lKPRdp5GnDV kb0hhcKqUnCq1E4EObMR7G6Lht8zmuOGXxCOkCgm55PcFi682OCw663MM+9nCJ7ClnOZ DM3LW+cIeDD6RZxazIMZrRX8zfPT0F7DFdyjeCxwCfLBC3gmpxNx4GlyB75dLjNwCN/e BE1qSBvZqMOujUeRDoO4ttzOSrk549mgLHd/tVuNyI+u2806AVo1Z4H6yIWZfP7tuun9 ILLhdWZRCrrfHX7WUwYVBQZCqGaQ6Txz1bS8WqaM3LjfeVCpLcchbK5LMj4aSmm8Hu8N og1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aoj5niqG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a7si7158545ilr.103.2021.09.06.06.37.32; Mon, 06 Sep 2021 06:37:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aoj5niqG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243030AbhIFM7W (ORCPT + 99 others); Mon, 6 Sep 2021 08:59:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:35462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242937AbhIFM6x (ORCPT ); Mon, 6 Sep 2021 08:58:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8ADE66103D; Mon, 6 Sep 2021 12:57:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1630933069; bh=aI/tw9ZEy2/QbQIju4vdgcAArBTdcRL2ytuXEqhp2og=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aoj5niqGnwV85ymVtL7nlqgYqL+kcxnjVWxteZ2m7mPRTDohhLiLd7Nm4J3ElluEW OadNIt5/YV8xPcjM8usPDSM0foXLekWDMFxwPaRKqeUqoCcPbYeyNX7uiTSnHJPuzO qoFGuCNUr0QTNaZMERmmW+sEJERhrnOmfsT0iMm8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold Subject: [PATCH 5.13 18/24] USB: serial: cp210x: fix control-characters error handling Date: Mon, 6 Sep 2021 14:55:47 +0200 Message-Id: <20210906125449.717812358@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210906125449.112564040@linuxfoundation.org> References: <20210906125449.112564040@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold commit 2d9a00705910ccea2dc5d9cba5469ff2de72fc87 upstream. In the unlikely event that setting the software flow-control characters fails the other flow-control settings should still be updated (just like all other terminal settings). Move out the error message printed by the set_chars() helper to make it more obvious that this is intentional. Fixes: 7748feffcd80 ("USB: serial: cp210x: add support for software flow control") Cc: stable@vger.kernel.org # 5.11 Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/cp210x.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c @@ -1110,10 +1110,8 @@ static int cp210x_set_chars(struct usb_s kfree(dmabuf); - if (result < 0) { - dev_err(&port->dev, "failed to set special chars: %d\n", result); + if (result < 0) return result; - } return 0; } @@ -1165,8 +1163,10 @@ static void cp210x_set_flow_control(stru chars.bXoffChar = STOP_CHAR(tty); ret = cp210x_set_chars(port, &chars); - if (ret) - return; + if (ret) { + dev_err(&port->dev, "failed to set special chars: %d\n", + ret); + } } mutex_lock(&port_priv->mutex);