Re: [PATCH v4] nbd: Fix memory leak in nbd_add_socket
From: Jens Axboe <axboe@kernel.dk>
Date: 2020-07-08 21:42:40
Also in:
lkml
From: Jens Axboe <axboe@kernel.dk>
Date: 2020-07-08 21:42:40
Also in:
lkml
On 6/28/20 7:23 PM, Zheng Bin wrote:
When adding first socket to nbd, if nsock's allocation failed, the data structure member "config->socks" was reallocated, but the data structure member "config->num_connections" was not updated. A memory leak will occur then because the function "nbd_config_put" will free "config->socks" only when "config->num_connections" is not zero.
Applied, thanks. -- Jens Axboe