diff --git a/block/nbd.c b/block/nbd.c index ed0f93ab27a9..976be7664786 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -1915,6 +1915,7 @@ static int nbd_open(BlockDriverState *bs, QDict *options, int flags, ret = nbd_client_connect(bs, errp); if (ret < 0) { + nbd_clear_bdrvstate(s); return ret; } /* successfully connected */