mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-25 07:14:36 +08:00
target/iblock: Use match_strlcpy for Opt_udev_path string assignment
Following commit dbc6e0222
from Al Viro for fileio, go ahead and make
Opt_udev_path within iblock_set_configfs_dev_params use match_strlcpy
instead of the match_strdup -> snprintf -> kfree equivalent.
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
This commit is contained in:
parent
35d1efe805
commit
852b6ed110
@ -454,14 +454,11 @@ static ssize_t iblock_set_configfs_dev_params(struct se_hba *hba,
|
|||||||
ret = -EEXIST;
|
ret = -EEXIST;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
arg_p = match_strdup(&args[0]);
|
if (match_strlcpy(ib_dev->ibd_udev_path, &args[0],
|
||||||
if (!arg_p) {
|
SE_UDEV_PATH_LEN) == 0) {
|
||||||
ret = -ENOMEM;
|
ret = -EINVAL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
snprintf(ib_dev->ibd_udev_path, SE_UDEV_PATH_LEN,
|
|
||||||
"%s", arg_p);
|
|
||||||
kfree(arg_p);
|
|
||||||
pr_debug("IBLOCK: Referencing UDEV path: %s\n",
|
pr_debug("IBLOCK: Referencing UDEV path: %s\n",
|
||||||
ib_dev->ibd_udev_path);
|
ib_dev->ibd_udev_path);
|
||||||
ib_dev->ibd_flags |= IBDF_HAS_UDEV_PATH;
|
ib_dev->ibd_flags |= IBDF_HAS_UDEV_PATH;
|
||||||
|
Loading…
Reference in New Issue
Block a user