Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2598990pxb; Tue, 21 Sep 2021 03:35:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5vjYmRmAfGK/U1GplvE3T/A7cq5+hbCPtVmCHoyh/TTnPplVDBRemHPX4rOZdKtPp1crB X-Received: by 2002:a17:906:32ce:: with SMTP id k14mr32922243ejk.503.1632220548922; Tue, 21 Sep 2021 03:35:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632220548; cv=none; d=google.com; s=arc-20160816; b=XFHiymP7XDKws+UOQJJHUXDMXPwXvT74JQehNhv2sYAbqVLlSnQ7xIEq3S1TvzUM61 wQtqxfFOLcwwI22wyFw9ZUeNw+6dLc2QHhqowAduVd6WUYV/yBOcE2KGDD4X7a1ZpdM7 FigLleSDCe7n3Qyy1EkaM46t9lfTosi/A520Ru/fJ9uOouW+lsk6FXmuDIZqPhXLEGc2 tNnaA2GovVzk3ZNf6/+m8OdoH16P561Dm+Rdsr7hmbivMJHJyimfveNBEImzVdFu7aC+ Cifn7WBHDxx73ppq6zZ6bkNOwfspoI99vb9j1IqVBKEOHTWJRG2rjTxGdd+nvWeyPX+Q Elkg== 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; bh=wpZDKpuD7XgOREZ+acxfoNUPnw3tRrOkxq9OwHrCpXY=; b=H4qaDXCElcABCIqpmUswhcRBNaDpbqCHT8I0DLwxnKd6YC0wg/PGwUvsJUUZJDZuBk gzERCLv0LMEo35QY4P2Hbo3HjNRt0qSbTPEAhw6xTyrvQNrqdHuDX9BGYM1KXnSEmJH8 eQzhAAwRwFM8uPtLf373DxepAdp49LP0n4zgp1rtwMOj0wOqcCL/fyG/9jc0VJ7j5SW+ EIyngMoy4PeGUgnqOxNkKeJ8ivVNxljrHZs4JHUnFvX8rd8zzdKWl0yZ9QDsyoaIP57N uFA4MpA7qGeh21kH2cMOE/IcvReCPMQNqPrFgkCxhe4VutyqtxzPVq9TjVI3MHRat2Qr 1k0w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz26si19350427ejc.485.2021.09.21.03.35.25; Tue, 21 Sep 2021 03:35:48 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231947AbhIUKf1 (ORCPT + 99 others); Tue, 21 Sep 2021 06:35:27 -0400 Received: from muru.com ([72.249.23.125]:35522 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231823AbhIUKf0 (ORCPT ); Tue, 21 Sep 2021 06:35:26 -0400 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 37951812F; Tue, 21 Sep 2021 10:34:24 +0000 (UTC) From: Tony Lindgren To: Greg Kroah-Hartman Cc: Andy Shevchenko , Jiri Slaby , Johan Hovold , Vignesh Raghavendra , linux-serial@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/6] tty: n_gsm: Don't ignore write return value in gsmld_output() Date: Tue, 21 Sep 2021 13:33:42 +0300 Message-Id: <20210921103346.64824-3-tony@atomide.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210921103346.64824-1-tony@atomide.com> References: <20210921103346.64824-1-tony@atomide.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We currently have gsmld_output() ignore the return value from device write. This means we will lose packets if device write returns 0 or an error. Signed-off-by: Tony Lindgren --- drivers/tty/n_gsm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -687,7 +687,7 @@ static void gsm_data_kick(struct gsm_mux *gsm, struct gsm_dlci *dlci) print_hex_dump_bytes("gsm_data_kick: ", DUMP_PREFIX_OFFSET, gsm->txframe, len); - if (gsmld_output(gsm, gsm->txframe, len) < 0) + if (gsmld_output(gsm, gsm->txframe, len) <= 0) break; /* FIXME: Can eliminate one SOF in many more cases */ gsm->tx_bytes -= msg->len; @@ -2358,8 +2358,7 @@ static int gsmld_output(struct gsm_mux *gsm, u8 *data, int len) if (debug & 4) print_hex_dump_bytes("gsmld_output: ", DUMP_PREFIX_OFFSET, data, len); - gsm->tty->ops->write(gsm->tty, data, len); - return len; + return gsm->tty->ops->write(gsm->tty, data, len); } /** -- 2.33.0