scst_vdisk: Introduce vdisk_on_free_cmd_params()

This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6837 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2016-03-24 17:13:46 +00:00
parent 4f10d6254e
commit fef250eb90

View File

@@ -3500,6 +3500,12 @@ static int fileio_exec(struct scst_cmd *cmd)
return vdev_do_job(cmd, ops);
}
static void vdisk_on_free_cmd_params(const struct vdisk_cmd_params *p)
{
if (p->iv != p->small_iv)
kfree(p->iv);
}
static void fileio_on_free_cmd(struct scst_cmd *cmd)
{
struct vdisk_cmd_params *p = cmd->dh_priv;
@@ -3524,8 +3530,7 @@ static void fileio_on_free_cmd(struct scst_cmd *cmd)
cmd->data_len = 0;
}
if (p->iv != p->small_iv)
kfree(p->iv);
vdisk_on_free_cmd_params(p);
kmem_cache_free(vdisk_cmd_param_cachep, p);