Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp575892pxx; Wed, 28 Oct 2020 11:29:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+LeZiqJPHosfA3idMqe5saSFNqOMb1GKh4whGFtIXbozs5p92QUtKaoHy2dPuJ+t077ZN X-Received: by 2002:a17:906:3cc:: with SMTP id c12mr415985eja.210.1603909778998; Wed, 28 Oct 2020 11:29:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603909778; cv=none; d=google.com; s=arc-20160816; b=INownBDbh0Johgtx5z0q/vy53a/hjbmrWl+rK1TF8yevuVK6jKr055I4urqJ9SRj7V ssB6rkEqX8cr+nb88KkUffwfjglw372UaRfJTGhhGsP1HlpVuuszG5QNq9YYgDNv+ZX/ nnBhDOe4+7A2eLsTR+bWD5ZBzZAcskDPdqGIorcQtE73qNbVqmjMDVqMs2GhOwL1z9mp a8p8BSSrZPn/VSrpVIEzJOrjUghC2e/FUQuJof86eI526PaHFt8KSIoaxywIaqEedFxx 6L8/6KwFE6w7RwmbnIOsWAiWxWM/BsoTPxzDc9DWe7g2Usb+7fHNzZVG1GZUuOHmmrw/ wEeQ== 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=xvKJVwUzCrV7Tm1bTAqcKRG8NDIiWvzPUGXDri3JEPE=; b=uSIWZDzvmA8OffCZJ/b25NzVV2uUp+/dSumUcBculYRIgcKzenp4KdDZjIPx6xGUuA rMzkyB+D1MOa11R+pl7Uh61LGeHejEuqAUSWrnJ+JiAlZMwpoafi2ShG8n4HojMSwezZ RuCjt1+OsPOzFkHggdpC2RbNJZtLVB6ckXHVkiKV2AdMgXwGiEgA6Vy3zUgB36tTOUtr 7qdWh1VtY4hMjr50DPT4lCjQETTmr4zFdV32IoVuji9gg9U9wvnGdf8hBfquWg3+2WEM SNqiug+Dmcnvp3mTme/g2X1qBaVeiJMAfIsTewBXLIoWPj9UsylhdDOWX98bmCqCMGgp kUyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mPEfPSa4; 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=fail (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 p9si37501edm.38.2020.10.28.11.29.16; Wed, 28 Oct 2020 11:29:38 -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=@kernel.org header.s=default header.b=mPEfPSa4; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1825112AbgJ0SIp (ORCPT + 99 others); Tue, 27 Oct 2020 14:08:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:37914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757048AbgJ0OP6 (ORCPT ); Tue, 27 Oct 2020 10:15:58 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 063D4206F7; Tue, 27 Oct 2020 14:15:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808157; bh=QYcM81sLsISILpc5HxmqUAgz3wRZVQRwhFtbk+II8B4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mPEfPSa40XfhXh7gT4NVSobksCUX+KDRES8A67MObXBcf89W/Y9hxKjjsDE/da8Z+ uEKfmqj/qaKRnzFfwSKHaZS2G4ym4Sh3HC+0aLvtzxZqTmMFQHplTdWsfGGOy+LQxM JG6CPwAtGocPiPaOq3NDqdaEaVUhI45IMQzp77PI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tong Zhang , David Sterba , Sasha Levin Subject: [PATCH 4.14 178/191] tty: ipwireless: fix error handling Date: Tue, 27 Oct 2020 14:50:33 +0100 Message-Id: <20201027134918.294734521@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134909.701581493@linuxfoundation.org> References: <20201027134909.701581493@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: Tong Zhang [ Upstream commit db332356222d9429731ab9395c89cca403828460 ] ipwireless_send_packet() can only return 0 on success and -ENOMEM on error, the caller should check non zero for error condition Signed-off-by: Tong Zhang Acked-by: David Sterba Link: https://lore.kernel.org/r/20200821161942.36589-1-ztong0001@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/ipwireless/network.c | 4 ++-- drivers/tty/ipwireless/tty.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/ipwireless/network.c b/drivers/tty/ipwireless/network.c index 695439c031474..abc737ae81d1c 100644 --- a/drivers/tty/ipwireless/network.c +++ b/drivers/tty/ipwireless/network.c @@ -117,7 +117,7 @@ static int ipwireless_ppp_start_xmit(struct ppp_channel *ppp_channel, skb->len, notify_packet_sent, network); - if (ret == -1) { + if (ret < 0) { skb_pull(skb, 2); return 0; } @@ -134,7 +134,7 @@ static int ipwireless_ppp_start_xmit(struct ppp_channel *ppp_channel, notify_packet_sent, network); kfree(buf); - if (ret == -1) + if (ret < 0) return 0; } kfree_skb(skb); diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c index 1ef751c27ac6d..cb04971843306 100644 --- a/drivers/tty/ipwireless/tty.c +++ b/drivers/tty/ipwireless/tty.c @@ -218,7 +218,7 @@ static int ipw_write(struct tty_struct *linux_tty, ret = ipwireless_send_packet(tty->hardware, IPW_CHANNEL_RAS, buf, count, ipw_write_packet_sent_callback, tty); - if (ret == -1) { + if (ret < 0) { mutex_unlock(&tty->ipw_tty_mutex); return 0; } -- 2.25.1