提交 ededd039 编写于 作者: B Bryant G. Ly 提交者: Nicholas Bellinger

tcmu: free old string on reconfig

On initial tcmu_configure_device call the info->name would
have already been allocated and set, so on the second call
make sure to free it first.
Reported-by: NMike Christie <mchristi@redhat.com>
Reviewed-by: NMike Christie <mchristi@redhat.com>
Signed-off-by: NBryant G. Ly <bryantly@linux.vnet.ibm.com>
Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
上级 c542942c
......@@ -1432,6 +1432,8 @@ static int tcmu_update_uio_info(struct tcmu_dev *udev)
if (udev->dev_config[0])
snprintf(str + used, size - used, "/%s", udev->dev_config);
/* If the old string exists, free it */
kfree(info->name);
info->name = str;
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册