diff options
author | Tong Zhang <ztong0001@gmail.com> | 2020-08-21 19:19:40 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-09-04 19:08:16 +0300 |
commit | db332356222d9429731ab9395c89cca403828460 (patch) | |
tree | f7ea2a8db3eef6f480aa55d3ff297cbaa4e18e74 /drivers/tty/ipwireless/network.c | |
parent | 68778cab29bf27a60b67f55d6f4710d9fa906eab (diff) | |
download | linux-db332356222d9429731ab9395c89cca403828460.tar.xz |
tty: ipwireless: fix error handling
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 <ztong0001@gmail.com>
Acked-by: David Sterba <dsterba@suse.com>
Link: https://lore.kernel.org/r/20200821161942.36589-1-ztong0001@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/ipwireless/network.c')
-rw-r--r-- | drivers/tty/ipwireless/network.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/ipwireless/network.c b/drivers/tty/ipwireless/network.c index cf20616340a1..fe569f6294a2 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); |