diff options
author | Joern Engel <joern@logfs.org> | 2014-09-03 01:50:00 +0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-09-18 02:20:57 +0400 |
commit | ce31c1b0dc4038a1dec64585d892adb73d9c45f4 (patch) | |
tree | 2c808d3d981f99f22fcafefddc716e79fc2faa5d /drivers/target/target_core_file.c | |
parent | 68edbce4fb4b173d3b9880967cfcce0fc3abc8d5 (diff) | |
download | linux-ce31c1b0dc4038a1dec64585d892adb73d9c45f4.tar.xz |
target: correctly handle match_int errors in FILEIO + PSCSI
This patch correctly handles match_int() errors in FILEIO + PSCSI
backend parameter parsing, which can potentially fail due to a
memory allocation failure or invalid argument.
Found by coverity.
Signed-off-by: Joern Engel <joern@logfs.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_file.c')
-rw-r--r-- | drivers/target/target_core_file.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index 7d6cddaec525..ab2c53b63cc3 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c @@ -762,7 +762,9 @@ static ssize_t fd_set_configfs_dev_params(struct se_device *dev, fd_dev->fbd_flags |= FBDF_HAS_SIZE; break; case Opt_fd_buffered_io: - match_int(args, &arg); + ret = match_int(args, &arg); + if (ret) + goto out; if (arg != 1) { pr_err("bogus fd_buffered_io=%d value\n", arg); ret = -EINVAL; |