diff options
author | Tong Zhang <ztong0001@gmail.com> | 2020-08-21 19:19:40 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-29 11:03:10 +0300 |
commit | 90ea33cdee3f5c63e673cc9096fb864bf0c9c016 (patch) | |
tree | 418f7fdccb8782436ae6545c73de3011c7bd1560 /drivers/tty/ipwireless/tty.c | |
parent | d0c18f883f6aaf7af3702491345d975fc68cdbf8 (diff) | |
download | linux-90ea33cdee3f5c63e673cc9096fb864bf0c9c016.tar.xz |
tty: ipwireless: fix error handling
[ 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 <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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/tty/ipwireless/tty.c')
-rw-r--r-- | drivers/tty/ipwireless/tty.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c index 345cebb07ae7..0b06b1847450 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; } |