summaryrefslogtreecommitdiffstats
path: root/drivers/net/wwan/wwan_core.c
diff options
context:
space:
mode:
authorLoic Poulain <loic.poulain@linaro.org>2021-04-22 16:06:01 +0200
committerDavid S. Miller <davem@davemloft.net>2021-04-22 13:26:02 -0700
commit57e222475545f457ecf4833db31f156e8b7674c7 (patch)
tree639a107519bfbe03b9ce987e7fc9e479f1f4cab1 /drivers/net/wwan/wwan_core.c
parenta9b5d871abc417cf65a05a9ba50c6b81a6e427eb (diff)
downloadlinux-57e222475545f457ecf4833db31f156e8b7674c7.tar.bz2
net: wwan: core: Return poll error in case of port removal
Ensure that the poll system call returns proper error flags when port is removed (nullified port ops), allowing user side to properly fail, without further read or write. Fixes: 9a44c1cc6388 ("net: Add a WWAN subsystem") Signed-off-by: Loic Poulain <loic.poulain@linaro.org> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wwan/wwan_core.c')
-rw-r--r--drivers/net/wwan/wwan_core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wwan/wwan_core.c b/drivers/net/wwan/wwan_core.c
index 5be5e1e3534c..cff04e532c1e 100644
--- a/drivers/net/wwan/wwan_core.c
+++ b/drivers/net/wwan/wwan_core.c
@@ -508,6 +508,8 @@ static __poll_t wwan_port_fops_poll(struct file *filp, poll_table *wait)
mask |= EPOLLOUT | EPOLLWRNORM;
if (!is_read_blocked(port))
mask |= EPOLLIN | EPOLLRDNORM;
+ if (!port->ops)
+ mask |= EPOLLHUP | EPOLLERR;
return mask;
}