]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/block/nbd.c
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
[karo-tx-linux.git] / drivers / block / nbd.c
index 1541cb880744cbfe2ad00c9d8532bcc5b2ad2f69..7e4287bc19e52991a82cf218906fe7384112921b 100644 (file)
@@ -675,8 +675,10 @@ static int nbd_clear_sock(struct nbd_device *nbd, struct block_device *bdev)
            nbd->num_connections) {
                int i;
 
-               for (i = 0; i < nbd->num_connections; i++)
+               for (i = 0; i < nbd->num_connections; i++) {
+                       sockfd_put(nbd->socks[i]->sock);
                        kfree(nbd->socks[i]);
+               }
                kfree(nbd->socks);
                nbd->socks = NULL;
                nbd->num_connections = 0;