From patchwork Thu Dec 22 13:54:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Boyer X-Patchwork-Id: 9485065 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 23025601D2 for ; Thu, 22 Dec 2016 13:55:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10ADE27FB6 for ; Thu, 22 Dec 2016 13:55:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03CCF2811C; Thu, 22 Dec 2016 13:55:27 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 9510727FB6 for ; Thu, 22 Dec 2016 13:55:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758005AbcLVNzZ (ORCPT ); Thu, 22 Dec 2016 08:55:25 -0500 Received: from esa5.dell-outbound.iphmx.com ([68.232.153.95]:52917 "EHLO esa5.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938661AbcLVNzZ (ORCPT ); Thu, 22 Dec 2016 08:55:25 -0500 DomainKey-Signature: s=smtpout; d=dell.com; c=simple; q=dns; h=Received:Received:Received:X-DKIM:Received:Received:From: To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To: References:X-RSA-Classifications:X-Sentrion-Hostname; b=GnNElRCXBAEvJUB3G9ibVxoA9QvI+sJmq/YUN6Y74Um/efe3onUxNh2l WfQfzJU+49l7XjKBMmwtQTnChRkCm0Fikuo65pbn4pWKA90YVaxP0WGUB rfng5tKqtJKs7oNm2Z594ANV5aH3BSjK/WzCdrXzxN7xsFUS4B/Lx5j/3 o=; DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1482414925; x=1513950925; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=yfovgW9xFJeBSTswyNWGSgiDp3RgPL2HvTBWHkWBddU=; b=oVhceVUB4KlTgIhiOeYVSWuWMGjIc90aW2GtQuuhy0MWHp4hho0xlLC4 QOO2eWB2fwuKNR8njQRiz64mFH52SyBKbcS+tl8TACkqiZxKFMFQOcjA0 W8muKxo8jW8yisWZvPQUdP1c6rLKt25/duc9uoXET1ZpGv1iXIcCcyqAW M=; Received: from esa1.dell-outbound2.iphmx.com ([68.232.153.201]) by esa5.dell-outbound.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Dec 2016 07:55:24 -0600 Received: from mailuogwhop.emc.com ([168.159.213.141]) by esa1.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Dec 2016 19:55:23 +0600 Received: from maildlpprd01.lss.emc.com (maildlpprd01.lss.emc.com [10.253.24.33]) by mailuogwprd03.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id uBMDtK1S000826 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 22 Dec 2016 08:55:22 -0500 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd03.lss.emc.com uBMDtK1S000826 Received: from mailapphubprd02.lss.emc.com (emcmail.lss.emc.com [10.253.24.52]) by maildlpprd01.lss.emc.com (RSA Interceptor); Thu, 22 Dec 2016 08:55:01 -0500 Received: from hopcyc-boyera-1.corp.emc.com (hopcyc-boyera-1.cec.lab.emc.com [10.244.91.191]) by mailapphubprd02.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id uBMDsn0l019387; Thu, 22 Dec 2016 08:55:12 -0500 From: Andrew Boyer To: monis@mellanox.com, yonatanc@mellanox.com, linux-rdma@vger.kernel.org Cc: Andrew Boyer Subject: [PATCH 3/3] IB/rxe: Don't check for null ptr in send() Date: Thu, 22 Dec 2016 08:54:38 -0500 Message-Id: <1482414878-6892-4-git-send-email-andrew.boyer@dell.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1482414878-6892-1-git-send-email-andrew.boyer@dell.com> References: <1482414878-6892-1-git-send-email-andrew.boyer@dell.com> X-RSA-Classifications: public X-Sentrion-Hostname: mailuogwprd03.lss.emc.com Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP pkt->qp was already dereferenced earlier in the function. Fixes Smatch complaint: drivers/infiniband/sw/rxe/rxe_net.c:458 send() warn: variable dereferenced before check 'pkt->qp' (see line 441) Signed-off-by: Andrew Boyer --- drivers/infiniband/sw/rxe/rxe_net.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c index 16967cd..342e781 100644 --- a/drivers/infiniband/sw/rxe/rxe_net.c +++ b/drivers/infiniband/sw/rxe/rxe_net.c @@ -455,8 +455,7 @@ static int send(struct rxe_dev *rxe, struct rxe_pkt_info *pkt, return -EAGAIN; } - if (pkt->qp) - atomic_inc(&pkt->qp->skb_out); + atomic_inc(&pkt->qp->skb_out); kfree_skb(skb); return 0;