mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-19 00:55:18 +00:00
um: vector: always reset vp->opened
If open fails, we have already set vp->opened, but it's not reset so that any further attempts will just return -ENXIO. Reset vp->opened even if close has nothing to do. This helps e.g. with slirp4netns handling only a single connection, you can then restart it and open the device again. Link: https://patch.msgid.link/20240703184622.df40c5c38461.Id4e20b48938c6019d99e6133227a34ac059db466@changeid Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
a0470a9f69
commit
98ff534ec2
1 changed files with 2 additions and 1 deletions
|
@ -1119,6 +1119,8 @@ static int vector_net_close(struct net_device *dev)
|
||||||
netif_stop_queue(dev);
|
netif_stop_queue(dev);
|
||||||
del_timer(&vp->tl);
|
del_timer(&vp->tl);
|
||||||
|
|
||||||
|
vp->opened = false;
|
||||||
|
|
||||||
if (vp->fds == NULL)
|
if (vp->fds == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -1157,7 +1159,6 @@ static int vector_net_close(struct net_device *dev)
|
||||||
destroy_queue(vp->tx_queue);
|
destroy_queue(vp->tx_queue);
|
||||||
kfree(vp->fds);
|
kfree(vp->fds);
|
||||||
vp->fds = NULL;
|
vp->fds = NULL;
|
||||||
vp->opened = false;
|
|
||||||
vp->in_error = false;
|
vp->in_error = false;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue