Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1122723pxx; Tue, 27 Oct 2020 08:46:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRVUpuKWi0f5zx47Q5E61PKW2HFsO7XaMvKaS8MlyXww0YR4Ce0wxca2bzpU4i+n5oEn3n X-Received: by 2002:a17:906:383:: with SMTP id b3mr2907070eja.351.1603813486714; Tue, 27 Oct 2020 08:44:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603813486; cv=none; d=google.com; s=arc-20160816; b=e2ugt2wWeW8VSC2WU/MtVw30IMZ7PK0OIYifb1b982JVIUbqDbj4bSmJ82kU4ZQGLT 8aL7Ps/zCD4eO3LIXIyXQCcumpQ9YBkPJTGWdB7hSr7/nd+IZxdsIKYDeXEBhylPQg12 7+Sis66BCAIrUIWqfK7Cb2G4NJ7tklUfAsjsgyTTm7EYgYbUB9vXAniEQVamoRVQuoQD /iBi8P3lro6ZMQAHG3TRX4c6H6vdJobMEZLEq94j9QM6IQnhT2eq28cGpZSdHgeofUzi p/HhKvL8ijVINJ+X0mscigxMjrV2MTUucy3boZfc0/LZ2RtWDKTLVMBNnZtHIum4AbAF TPag== 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=HJqtpg1I5wIPK7si/6NDpV5QhICUW3PAtOQZ9pHrx6M=; b=j7eUfknwF/2aY+EJQqp9h8uH5IxGfdRKXjmtppxtRDtF59ut/FDwLWEO2OPzdL2lfw d5l/MTmjTMJsQNZHBXNy1lhxXgST6BFeh3WGNPjKMGrl0bJhnf6+VVHZvj8RjwPXIKo4 IR1a1dUjw7JoAxB128Gqd3Tm8NIU/zBH3dQBZ0b/fV7GXQAWUdIvHaRwYVwcVZKBq4ij /r1NBATdXq1rEyygqHiRYcmflMceMCIv7VpV9tIjMGZ4UtRRgIGQ8aqpeepPLodvPpNM FqiHewOUW0i0Cf3MG4a/C5XySdVAsnnhcqrXoG4maU5pZHRC+UueiUzfWAGtHuhPSxqO P4Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=efMeYg3G; 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 sd16si1244194ejb.498.2020.10.27.08.44.24; Tue, 27 Oct 2020 08:44:46 -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=efMeYg3G; 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 S1765962AbgJ0Oro (ORCPT + 99 others); Tue, 27 Oct 2020 10:47:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:47458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764985AbgJ0Ore (ORCPT ); Tue, 27 Oct 2020 10:47:34 -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 E91F420709; Tue, 27 Oct 2020 14:47:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810054; bh=NUpYaUvmRHTOgcrRsFl9wEtzDPIV1E43uReBfkuDdaY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=efMeYg3GVcBIddbDLyLt1lqDJ2RKfjR3qQmMs7Wm/TFdG1kSMQkaDXWC5BRZYcSM4 nbVG6i9YTLEtpBCae+4sw9sq5iMJHnCDlLNpNqS8EIaoWPeUWZW4Rz7nEgXfcOI3n2 MVhvTg5sg3QeaRy8h1o1gwVEur4wv5ETMiQqBgys= 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 5.4 386/408] tty: ipwireless: fix error handling Date: Tue, 27 Oct 2020 14:55:24 +0100 Message-Id: <20201027135512.904969764@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 cf20616340a1a..fe569f6294a24 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 fad3401e604d9..23584769fc292 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