From patchwork Thu Aug 24 11:59:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tang.wenji@zte.com.cn X-Patchwork-Id: 9919891 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BB1ED60353 for ; Thu, 24 Aug 2017 11:59:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A63428BE0 for ; Thu, 24 Aug 2017 11:59:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98F47286C1; Thu, 24 Aug 2017 11:59:29 +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=-6.9 required=2.0 tests=BAYES_00,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 D916128BE9 for ; Thu, 24 Aug 2017 11:59:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751349AbdHXL70 (ORCPT ); Thu, 24 Aug 2017 07:59:26 -0400 Received: from mxhk.zte.com.cn ([63.217.80.70]:53431 "EHLO mxhk.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751333AbdHXL7Z (ORCPT ); Thu, 24 Aug 2017 07:59:25 -0400 X-scanvirus: By SEG_CYREN AntiVirus Engine X-scanresult: CLEAN X-MAILFROM: X-RCPTTO: X-FROMIP: 10.30.3.20 X-SEG-Scaned: 1 X-Received: unknown,10.30.3.20,20170824195905 Received: from unknown (HELO mse01.zte.com.cn) (10.30.3.20) by localhost with (AES256-SHA encrypted) SMTP; 24 Aug 2017 11:59:05 -0000 Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id v7OBxEv4052790; Thu, 24 Aug 2017 19:59:14 +0800 (GMT-8) (envelope-from tang.wenji@zte.com.cn) Received: from localhost.localdomain ([10.118.202.203]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2017082419592032-714516 ; Thu, 24 Aug 2017 19:59:20 +0800 From: tang.wenji@zte.com.cn To: Nicholas Bellinger Cc: target-devel@vger.kernel.org, tangwenji Subject: [PATCH] target:fix condition return in core_pr_dump_initiator_port() Date: Thu, 24 Aug 2017 19:59:37 +0800 Message-Id: <20170824115937.2592-1-tang.wenji@zte.com.cn> X-Mailer: git-send-email 2.13.2.windows.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-08-24 19:59:20, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2017-08-24 19:59:03, Serialize complete at 2017-08-24 19:59:03 X-MAIL: mse01.zte.com.cn v7OBxEv4052790 X-HQIP: 127.0.0.1 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 When is pr_reg->isid_present_at_reg is false,this function should return. Signed-off-by: tangwenji --- drivers/target/target_core_pr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c index 6d5def64db61..cff99ce253e7 100644 --- a/drivers/target/target_core_pr.c +++ b/drivers/target/target_core_pr.c @@ -58,8 +58,10 @@ void core_pr_dump_initiator_port( char *buf, u32 size) { - if (!pr_reg->isid_present_at_reg) + if (!pr_reg->isid_present_at_reg) { buf[0] = '\0'; + return; + } snprintf(buf, size, ",i,0x%s", pr_reg->pr_reg_isid); }