Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp165765pxx; Wed, 28 Oct 2020 01:19:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSbePvPzPFUF0+qoGRzhivSrtz4MzamszK+smtJfVISCKZUiDYW0QlagHfollLuxzUExTm X-Received: by 2002:a17:907:435e:: with SMTP id oc22mr6740800ejb.485.1603873155559; Wed, 28 Oct 2020 01:19:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603873155; cv=none; d=google.com; s=arc-20160816; b=Z8nbJ7Zl40BMv/1hPbAUCzqsGhdMP1yZ3omT6iJanp+UPtmJ+CykgnLQs2dAMzvlVV SWwLedI6KKsH327nRbu3n6fgWI0LIg5Vokhyzf0DbAv8941jRl9XfBbMCoS8zf3ebuCX KP54Pw5kbtBGfEKDhm1DIWYcz6BvdLh75ToYCY0htyfhnw7Jt9AFx8T+/UNS5+37GPLd J0v4fL01shNPcTuH9F0WPkhA1UzWCFBWdPFC2isuNN/hekL6ctP854bJinaTxtiOcOOG eyAS0mm3nG9oa36s+zcPBMc1rEuOs2gXSM2CbT3zLkATCUkqzXavfLU2NA1U3ZlnnVs+ Wy/Q== 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=QbWrB/xjCd+ocO02R+D6+p6x/vqQbKdq0scohvuPchk=; b=baetYuWLt6Dbki0aJ0QHE4pKDfAeCC79IaMILOD1QgyhhpdO+8Nq5zlbcKz6+UFVCA rfpKmwo6vrOEIYC38d5+8jZS9wsjXE6w4PhQpvp1/0OxZ49tVrmtrAk8DNt/P+Dt6z15 O5welYd4d/y9Uwk0BU9jGC1IUuPAvOlYtni6NzfL8ccLZBEuOjoKCYe1fnoW7FIZAiXx igQ55ecUxJpLD585SU8rV5B8Yv1ZsypxW8Aa+Dr72oKVy5JKok8LoC7Q03t+LbHwWArP PLp+MoDBHG2TFOQbfMQS+yLKVHrvRXqYcEIkOJnZgbPfPr6zmtClFrwARQqMidj7e6TB gLsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Hxil8a2X; 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 z8si2802677eju.267.2020.10.28.01.18.52; Wed, 28 Oct 2020 01:19:15 -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=Hxil8a2X; 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 S1753744AbgJ0OB4 (ORCPT + 99 others); Tue, 27 Oct 2020 10:01:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:48712 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753611AbgJ0OBI (ORCPT ); Tue, 27 Oct 2020 10:01:08 -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 361B3221F8; Tue, 27 Oct 2020 14:01:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807266; bh=nE9sYJGW7Gd3tHtoSy/tIeKH2o8k6bvzAfO/B54u6P4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hxil8a2XLQlKJg4jMvGZnPQJnruiEx4CMxPIhHezYZS4ioD2zzWK0/T/UejrkvchB 1MLCXFz3EOMKsmHmthI3+o0xboT8XegxTh8VFPiLAs4FLKrDR59vrh3267mJQQPmz1 Qum61d2VEyXziBKBxWLre2ZFmUJSLONjXnJ515Bw= 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.4 104/112] tty: ipwireless: fix error handling Date: Tue, 27 Oct 2020 14:50:14 +0100 Message-Id: <20201027134905.471042795@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134900.532249571@linuxfoundation.org> References: <20201027134900.532249571@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 c0dfb642383b2..dc7f4eb18e0a7 100644 --- a/drivers/tty/ipwireless/network.c +++ b/drivers/tty/ipwireless/network.c @@ -116,7 +116,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; } @@ -133,7 +133,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 345cebb07ae79..0b06b1847450f 100644 --- a/drivers/tty/ipwireless/tty.c +++ b/drivers/tty/ipwireless/tty.c @@ -217,7 +217,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