Re: [PATCH 1/1] vduse: moving kvfree into caller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 6, 2021 at 3:54 PM Guanjun <guanjun@xxxxxxxxxxxxxxxxx> wrote:
>
> From: Guanjun <guanjun@xxxxxxxxxxxxxxxxx>
>
> This free action should be moved into caller 'vduse_ioctl' in
> concert with the allocation.
>
> No functional change.
>
> Fixes: c8a6153b6c59 ("vduse: Introduce VDUSE - vDPA Device in Userspace")

Does this fix a real problem? If not, let's try not using fixes tags here.

Thanks

> Signed-off-by: Guanjun <guanjun@xxxxxxxxxxxxxxxxx>
> ---
>  drivers/vdpa/vdpa_user/vduse_dev.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/vdpa/vdpa_user/vduse_dev.c b/drivers/vdpa/vdpa_user/vduse_dev.c
> index c9204c62f339..477a5a592002 100644
> --- a/drivers/vdpa/vdpa_user/vduse_dev.c
> +++ b/drivers/vdpa/vdpa_user/vduse_dev.c
> @@ -1355,7 +1355,6 @@ static int vduse_create_dev(struct vduse_dev_config *config,
>  err_str:
>         vduse_dev_destroy(dev);
>  err:
> -       kvfree(config_buf);
>         return ret;
>  }
>
> @@ -1406,6 +1405,8 @@ static long vduse_ioctl(struct file *file, unsigned int cmd,
>                 }
>                 config.name[VDUSE_NAME_MAX - 1] = '\0';
>                 ret = vduse_create_dev(&config, buf, control->api_version);
> +               if (ret)
> +                       kvfree(buf);
>                 break;
>         }
>         case VDUSE_DESTROY_DEV: {
> --
> 2.27.0
>

_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization



[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux