[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/1] /hw/scsi/vhost-scsi.c: Fix a memory leak
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 1/1] /hw/scsi/vhost-scsi.c: Fix a memory leak |
Date: |
Wed, 9 Dec 2020 14:32:30 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 |
Hi,
On 12/9/20 12:59 PM, ruc_gongyuanjun@163.com wrote:
> From: yuanjungong <ruc_gongyuanjun@163.com>
>
> close vhostfd before returning.
>
> Signed-off-by: yuanjungong <ruc_gongyuanjun@163.com>
> ---
> hw/scsi/vhost-scsi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
> index 4d70fa0..9d12034 100644
> --- a/hw/scsi/vhost-scsi.c
> +++ b/hw/scsi/vhost-scsi.c
> @@ -232,7 +232,7 @@ static void vhost_scsi_realize(DeviceState *dev, Error
> **errp)
> /* Note: we can also get the minimum tpgt from kernel */
> vsc->target = vs->conf.boot_tpgt;
>
> - return;
> + goto clode_fd;
'close_fd' I presume? Please test your patch :)
>
> free_vqs:
> if (!vsc->migratable) {
>