Re: [PATCH 16/17] target: handle match_int failures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/28/2014 4:01 AM, Joern Engel wrote:
Found by coverity.

Signed-off-by: Joern Engel <joern@xxxxxxxxx>
---
  drivers/target/target_core_pscsi.c | 16 ++++++++++++----
  1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c
index 943b1dbe859a..a1690a3fdd7f 100644
--- a/drivers/target/target_core_pscsi.c
+++ b/drivers/target/target_core_pscsi.c
@@ -749,14 +749,18 @@ static ssize_t pscsi_set_configfs_dev_params(struct se_device *dev,
  				ret = -EINVAL;
  				goto out;
  			}
-			match_int(args, &arg);
+			ret = match_int(args, &arg);
+			if (ret)
+				goto out;
  			pdv->pdv_host_id = arg;
  			pr_debug("PSCSI[%d]: Referencing SCSI Host ID:"
  				" %d\n", phv->phv_host_id, pdv->pdv_host_id);
  			pdv->pdv_flags |= PDF_HAS_VIRT_HOST_ID;
  			break;
  		case Opt_scsi_channel_id:
-			match_int(args, &arg);
+			ret = match_int(args, &arg);
+			if (ret)
+				goto out;
  			pdv->pdv_channel_id = arg;
  			pr_debug("PSCSI[%d]: Referencing SCSI Channel"
  				" ID: %d\n",  phv->phv_host_id,
@@ -764,7 +768,9 @@ static ssize_t pscsi_set_configfs_dev_params(struct se_device *dev,
  			pdv->pdv_flags |= PDF_HAS_CHANNEL_ID;
  			break;
  		case Opt_scsi_target_id:
-			match_int(args, &arg);
+			ret = match_int(args, &arg);
+			if (ret)
+				goto out;
  			pdv->pdv_target_id = arg;
  			pr_debug("PSCSI[%d]: Referencing SCSI Target"
  				" ID: %d\n", phv->phv_host_id,
@@ -772,7 +778,9 @@ static ssize_t pscsi_set_configfs_dev_params(struct se_device *dev,
  			pdv->pdv_flags |= PDF_HAS_TARGET_ID;
  			break;
  		case Opt_scsi_lun_id:
-			match_int(args, &arg);
+			ret = match_int(args, &arg);
+			if (ret)
+				goto out;
  			pdv->pdv_lun_id = arg;
  			pr_debug("PSCSI[%d]: Referencing SCSI LUN ID:"
  				" %d\n", phv->phv_host_id, pdv->pdv_lun_id);


Shouldn't this be squashed with 14/17?
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux