From fef250eb90d27e4a788ef17cbb2e445112d82d41 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 24 Mar 2016 17:13:46 +0000 Subject: [PATCH] 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 --- scst/src/dev_handlers/scst_vdisk.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index b967c7c1b..22bf2dcad 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -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);