summaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2012-08-22 18:45:11 -0700
committerNicholas Bellinger <nab@linux-iscsi.org>2012-09-17 17:13:32 -0700
commit852b6ed110990891d21bf76b4f46a3c854866f67 (patch)
treee5251d6b288ae720af4a374198afa37da5233c95 /drivers/target
parent35d1efe80500a55f9aa01b305a6714ec78c33764 (diff)
downloadblackbird-op-linux-852b6ed110990891d21bf76b4f46a3c854866f67.tar.gz
blackbird-op-linux-852b6ed110990891d21bf76b4f46a3c854866f67.zip
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>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_iblock.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 9ba495477fd2..0f6ece80bffe 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -454,14 +454,11 @@ static ssize_t iblock_set_configfs_dev_params(struct se_hba *hba,
ret = -EEXIST;
goto out;
}
- arg_p = match_strdup(&args[0]);
- if (!arg_p) {
- ret = -ENOMEM;
+ if (match_strlcpy(ib_dev->ibd_udev_path, &args[0],
+ SE_UDEV_PATH_LEN) == 0) {
+ ret = -EINVAL;
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",
ib_dev->ibd_udev_path);
ib_dev->ibd_flags |= IBDF_HAS_UDEV_PATH;
OpenPOWER on IntegriCloud