From patchwork Wed Jul 1 05:43:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anil Gurumurthy X-Patchwork-Id: 6700121 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9D745C05AC for ; Wed, 1 Jul 2015 05:43:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 84C3420660 for ; Wed, 1 Jul 2015 05:43:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 42F56204A0 for ; Wed, 1 Jul 2015 05:43:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751398AbbGAFnn (ORCPT ); Wed, 1 Jul 2015 01:43:43 -0400 Received: from mx0b-0016ce01.pphosted.com ([67.231.156.153]:38406 "EHLO mx0b-0016ce01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751106AbbGAFnm (ORCPT ); Wed, 1 Jul 2015 01:43:42 -0400 Received: from pps.filterd (m0000643.ppops.net [127.0.0.1]) by mx0b-0016ce01.pphosted.com (8.14.5/8.14.5) with SMTP id t615hftK018533 for ; Tue, 30 Jun 2015 22:43:41 -0700 Received: from avcashub1.qlogic.com (avcashub1.qlogic.com [198.70.193.115]) by mx0b-0016ce01.pphosted.com with ESMTP id 1v8yrne5re-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Tue, 30 Jun 2015 22:43:41 -0700 Received: from AVMB2.qlogic.org ([fe80::cdfd:9ba8:5afa:475c]) by avcashub1.qlogic.org ([::1]) with mapi id 14.03.0235.001; Tue, 30 Jun 2015 22:43:39 -0700 From: Anil Gurumurthy To: Maninder Singh , Sudarsana Kalluru , "JBottomley@odin.com" , linux-scsi CC: "pankaj.m@samsung.com" Subject: RE: [PATCH 1/1] SCSI/bfa: Use port pointer after NULL check Thread-Topic: [PATCH 1/1] SCSI/bfa: Use port pointer after NULL check Thread-Index: AQHQsitwXvqPo4/2tE6IPhvQE5KsU53GHVvA Date: Wed, 1 Jul 2015 05:43:36 +0000 Message-ID: <20B1A3CBD98F3845B3F5F56D8597EF590102D05C@avmb2.qlogic.org> References: <1435555263-7954-1-git-send-email-maninder1.s@samsung.com> In-Reply-To: <1435555263-7954-1-git-send-email-maninder1.s@samsung.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <20B1A3CBD98F3845B3F5F56D8597EF590102D05C@avmb2.qlogic.org> x-originating-ip: [10.1.4.10] disclaimer: bypass MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5700 definitions=7848 signatures=670599 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1506180000 definitions=main-1507010101 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Acked-by: Anil Gurumurthy -----Original Message----- From: Maninder Singh [mailto:maninder1.s@samsung.com] Sent: 29 June 2015 10:51 To: Anil Gurumurthy; Sudarsana Kalluru; JBottomley@odin.com; linux-scsi Cc: pankaj.m@samsung.com; Maninder Singh Subject: [PATCH 1/1] SCSI/bfa: Use port pointer after NULL check Currently port pointer is derefrenced before NULL check. So NULL check is misleading, Thus it is better to use port pointer after NULL Check. Signed-off-by: Maninder Singh Reviewed-by: Akhilesh Kumar --- drivers/scsi/bfa/bfa_fcs_lport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 1.7.9.5 diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c index ff75ef8..542d5c6 100644 --- a/drivers/scsi/bfa/bfa_fcs_lport.c +++ b/drivers/scsi/bfa/bfa_fcs_lport.c @@ -5826,12 +5826,13 @@ bfa_fcs_lport_get_rport_max_speed(bfa_fcs_lport_t *port) bfa_port_speed_t max_speed = 0; struct bfa_port_attr_s port_attr; bfa_port_speed_t port_speed, rport_speed; - bfa_boolean_t trl_enabled = bfa_fcport_is_ratelim(port->fcs->bfa); + bfa_boolean_t trl_enabled; if (port == NULL) return 0; + trl_enabled = bfa_fcport_is_ratelim(port->fcs->bfa); fcs = port->fcs; /* Get Physical port's current speed */