Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp5818pxb; Wed, 29 Sep 2021 23:08:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzocnqzU99PhvkAzfeX4ZtB4noSlim5iaE2Q4cSy5VAtb/BX5d1hU/7iKV9RtQjteJvUgLy X-Received: by 2002:a17:902:868c:b0:13c:8ce5:92b3 with SMTP id g12-20020a170902868c00b0013c8ce592b3mr3819809plo.13.1632982123254; Wed, 29 Sep 2021 23:08:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632982123; cv=none; d=google.com; s=arc-20160816; b=OzZWTZy4NBobXpCOTknoTmLinx9mAwbfoczFVwX3UdBkE9KeZWEG5HSSLyiS4KjvoE 2HtaWeqQ9p8Ow/960XbYMmv6mP2OXdY3C9r36s7wId5pSTILDgAIhusJjCU4JDiUs5nV 83izM9stJMUj2dHRXx1pT9q+DPYNFY+9JuhuCg8ngd1uEHK20P0ms0GuQ+7io76dB1EQ SqQIwSOOvmOeOz7dMWcC63lYChw82iUApeGqkBPyADV8MG2kAZ+a5SbR0K/bQa0Bfliy rWuOQjefxuwoVBN6ebKUHGZXNY0RjgmoiCxqi/cEWPUbJXshAM093z/1pslZQkXgE3cM Zi5A== 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 :message-id:date:subject:cc:to:from; bh=wpZDKpuD7XgOREZ+acxfoNUPnw3tRrOkxq9OwHrCpXY=; b=FZMXwymF2chSLjOJgkDhkLV/VtvIBAx9nP6ygYcBaZ+EHNO3zdw9gOXBldfEoNWJF7 iMd6/BrnitOMK1WqDWUtlTI3e0vUOc4b04pmy2iNCJaqNxch2FqHPuEWiGKfzwBPEVQi 0wYlNRbaRuZy5+LyMGMVH/k/YELUXh4FOCEcI87Oa0vb2bqCTWMrMjJBH2XCJd5aG7Kw hQEfeVNM1v60q3kGLD2Z0OG+BC3I5F4Uspg/W1+4Q8gUbPLfL3k72Wrqx33B/no59Orq ORgLaFMmIobf1E9PzqhYfb036sApplTQnuIqvN+/CgeF+CxMNYhuRjSTVyW65ZRg8iwh /4dg== 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 p123si2501353pfg.327.2021.09.29.23.08.28; Wed, 29 Sep 2021 23:08: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; 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 S1348226AbhI3GIO (ORCPT + 99 others); Thu, 30 Sep 2021 02:08:14 -0400 Received: from muru.com ([72.249.23.125]:38814 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347847AbhI3GIN (ORCPT ); Thu, 30 Sep 2021 02:08:13 -0400 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 45CF780CF; Thu, 30 Sep 2021 06:06:59 +0000 (UTC) From: Tony Lindgren To: Greg Kroah-Hartman Cc: Gregory CLEMENT , Jiri Slaby , Johan Hovold , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] tty: n_gsm: Don't ignore write return value in gsmld_output() Date: Thu, 30 Sep 2021 09:06:24 +0300 Message-Id: <20210930060624.46523-1-tony@atomide.com> X-Mailer: git-send-email 2.33.0 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