Skip to content

Commit 98ff534

Browse files
committed
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 <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
1 parent a0470a9 commit 98ff534

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/um/drivers/vector_kern.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,8 @@ static int vector_net_close(struct net_device *dev)
11191119
netif_stop_queue(dev);
11201120
del_timer(&vp->tl);
11211121

1122+
vp->opened = false;
1123+
11221124
if (vp->fds == NULL)
11231125
return 0;
11241126

@@ -1157,7 +1159,6 @@ static int vector_net_close(struct net_device *dev)
11571159
destroy_queue(vp->tx_queue);
11581160
kfree(vp->fds);
11591161
vp->fds = NULL;
1160-
vp->opened = false;
11611162
vp->in_error = false;
11621163
return 0;
11631164
}

0 commit comments

Comments
 (0)