vduse: moving kvfree into caller
Subsystems (2)
PATCH v2 1/1 vduse: moving kvfree into caller
From: Guanjun <[email protected]>
This free action should be moved into caller 'vduse_ioctl' in concert with the allocation.
No functional change.
Signed-off-by Guanjun <[email protected]>
--- drivers/vdpa/vdpa_user/vduse_dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/vdpa/vdpa_user/vduse_dev.c +2 -1
@@ -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 : {
Signature · 1 line
2.27.0