All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2] net: wwan: core: Return poll error in case of port removal
@ 2021-04-22 14:06 Loic Poulain
  2021-04-22 15:02 ` Leon Romanovsky
  2021-04-22 20:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Loic Poulain @ 2021-04-22 14:06 UTC (permalink / raw)
  To: kuba, davem, leon; +Cc: netdev, Loic Poulain

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>
---
 v2: get rid of useless locking for accessing port->ops

 drivers/net/wwan/wwan_core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wwan/wwan_core.c b/drivers/net/wwan/wwan_core.c
index 5be5e1e..cff04e5 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;
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next v2] net: wwan: core: Return poll error in case of port removal
  2021-04-22 14:06 [PATCH net-next v2] net: wwan: core: Return poll error in case of port removal Loic Poulain
@ 2021-04-22 15:02 ` Leon Romanovsky
  2021-04-22 20:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2021-04-22 15:02 UTC (permalink / raw)
  To: Loic Poulain; +Cc: kuba, davem, netdev

On Thu, Apr 22, 2021 at 04:06:01PM +0200, Loic Poulain wrote:
> 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>
> ---
>  v2: get rid of useless locking for accessing port->ops
> 
>  drivers/net/wwan/wwan_core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 

Please take my ROB with a grain of salt.

Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next v2] net: wwan: core: Return poll error in case of port removal
  2021-04-22 14:06 [PATCH net-next v2] net: wwan: core: Return poll error in case of port removal Loic Poulain
  2021-04-22 15:02 ` Leon Romanovsky
@ 2021-04-22 20:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-04-22 20:30 UTC (permalink / raw)
  To: Loic Poulain; +Cc: kuba, davem, leon, netdev

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Thu, 22 Apr 2021 16:06:01 +0200 you wrote:
> 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>
> 
> [...]

Here is the summary with links:
  - [net-next,v2] net: wwan: core: Return poll error in case of port removal
    https://git.kernel.org/netdev/net-next/c/57e222475545

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-22 20:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22 14:06 [PATCH net-next v2] net: wwan: core: Return poll error in case of port removal Loic Poulain
2021-04-22 15:02 ` Leon Romanovsky
2021-04-22 20:30 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.