From patchwork Sun Mar 10 14:43:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tangwenji X-Patchwork-Id: 10846315 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DD276922 for ; Sun, 10 Mar 2019 14:42:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C68BC28F19 for ; Sun, 10 Mar 2019 14:42:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BACFF28FC4; Sun, 10 Mar 2019 14:42:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53C3028F19 for ; Sun, 10 Mar 2019 14:42:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726432AbfCJOmp (ORCPT ); Sun, 10 Mar 2019 10:42:45 -0400 Received: from m12-13.163.com ([220.181.12.13]:51134 "EHLO m12-13.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725939AbfCJOmp (ORCPT ); Sun, 10 Mar 2019 10:42:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=7PG1azyJm+VqNMadFU bhddLeLysYZzkIGt1GHz+4gBE=; b=Is5h6MpY07d8pvFWQxgLm5ABkbp0t1p40Z C5Rzg2I2As1yOkSmbklxNBCWsLje3P89g37ijwd3NXlQyOTfI9KM6uZZQVniOdYC hcIi5iy0EFKSYV9tSIgBc50nGBuBGxlUzlaQ1v7Mr87LiCFTvoVFnOlcJ7IJqUcU Hh5ufFHxg= Received: from localhost.localdomain (unknown [222.247.86.88]) by smtp9 (Coremail) with SMTP id DcCowAA3sKVeIoVcs6G0Iw--.33543S2; Sun, 10 Mar 2019 22:42:39 +0800 (CST) From: tangwenji To: "Martin K. Petersen" Cc: target-devel@vger.kernel.org, tangwenji Subject: [PATCH] target: fix the exceptioin handling in target_pr_res_aptpl_metadata_store Date: Sun, 10 Mar 2019 22:43:18 +0800 Message-Id: <1552228998-3044-1-git-send-email-hndksztwj@163.com> X-Mailer: git-send-email 2.5.0.windows.1 X-CM-TRANSID: DcCowAA3sKVeIoVcs6G0Iw--.33543S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7tFyrJF1UGFyfGr1xGF1kAFb_yoW8JFy8pF Z8A34xWr4Dtay8Gr4UCayv93WUW3yxAFWUC3yxJ3WfA343AryUCrnYk3y7tF1UJFWkGry3 Wa4vyFyYgFW8ZwUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07j7739UUUUU= X-Originating-IP: [222.247.86.88] X-CM-SenderInfo: 5kqgy2h2wzyqqrwthudrp/1tbiRR9zQ1l9pMA2+wAAsn Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: tangwenji The function should exit when the i_port,isid and t_port length exceed the specified value. Signed-off-by: tangwenji --- drivers/target/target_core_configfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index fc5ef31..eff2ff5 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c @@ -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: