diff options
author | Guanjun <guanjun@linux.alibaba.com> | 2021-12-06 09:48:18 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2022-01-15 00:50:52 +0100 |
commit | b4d80c8dda229c830f0ba38c103e5263c2a7bc64 (patch) | |
tree | 99c8c3e00b00c3b1e6c39c9a4c7872d06debb3b2 /drivers/vdpa/vdpa_user | |
parent | hwrng: virtio - unregister device before reset (diff) | |
download | linux-b4d80c8dda229c830f0ba38c103e5263c2a7bc64.tar.xz linux-b4d80c8dda229c830f0ba38c103e5263c2a7bc64.zip |
vduse: moving kvfree into caller
This free action should be moved into caller 'vduse_ioctl' in
concert with the allocation.
No functional change.
Signed-off-by: Guanjun <guanjun@linux.alibaba.com>
Link: https://lore.kernel.org/r/1638780498-55571-1-git-send-email-guanjun@linux.alibaba.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vdpa/vdpa_user')
-rw-r--r-- | drivers/vdpa/vdpa_user/vduse_dev.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/vdpa/vdpa_user/vduse_dev.c b/drivers/vdpa/vdpa_user/vduse_dev.c index eddcb64a910a..f3cc7dde39af 100644 --- a/drivers/vdpa/vdpa_user/vduse_dev.c +++ b/drivers/vdpa/vdpa_user/vduse_dev.c @@ -1357,7 +1357,6 @@ err_domain: err_str: vduse_dev_destroy(dev); err: - kvfree(config_buf); return ret; } @@ -1408,6 +1407,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: { |