Skip to contentSkip to conversation

target: fix the exceptioin handling in target_pr_res_aptpl_metadata_store

PATCH New tangwenji 1 participant 1 message Mar 10, 2019 SCSI target

lore
Share & tools
lore

tangwenji

author
#0 lore raw

PATCH 1/1 target: fix the exceptioin handling in target_pr_res_aptpl_metadata_store

From: tangwenji <[email protected]>

The function should exit when the i_port,isid and t_port length exceed the specified value.

---
 drivers/target/target_core_configfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/target/target_core_configfs.c +3 -3
index fc5ef31..eff2ff5 100644
@@ -1773,7 +1773,7 @@ static ssize_t target_pr_res_aptpl_metadata_store(struct config_item *item,
 					" exceeds PR_APTPL_MAX_IPORT_LEN: %d\n",
 					PR_APTPL_MAX_IPORT_LEN);
 				ret = -EINVAL;
-				break;
+				goto out;
 			}
 			break;
 		case Opt_initiator_sid:
@@ -1787,7 +1787,7 @@ static ssize_t target_pr_res_aptpl_metadata_store(struct config_item *item,
 					"= exceeds PR_REG_ISID_LEN: %d\n",
 					PR_REG_ISID_LEN);
 				ret = -EINVAL;
-				break;
+				goto out;
 			}
 			break;
 		case Opt_sa_res_key:
@@ -1851,7 +1851,7 @@ static ssize_t target_pr_res_aptpl_metadata_store(struct config_item *item,
 					" exceeds PR_APTPL_MAX_TPORT_LEN: %d\n",
 					PR_APTPL_MAX_TPORT_LEN);
 				ret = -EINVAL;
-				break;
+				goto out;
 			}
 			break;
 		case Opt_tpgt:
Signature · 1 line
2.5.0.windows.1