From patchwork Tue Oct 30 13:54:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Boyer X-Patchwork-Id: 10660961 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 D497013A4 for ; Tue, 30 Oct 2018 14:03:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BABD528748 for ; Tue, 30 Oct 2018 14:03:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE627287C8; Tue, 30 Oct 2018 14:03:32 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 5A66428748 for ; Tue, 30 Oct 2018 14:03:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728092AbeJ3W5G (ORCPT ); Tue, 30 Oct 2018 18:57:06 -0400 Received: from esa4.dell-outbound.iphmx.com ([68.232.149.214]:63317 "EHLO esa4.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728182AbeJ3W5G (ORCPT ); Tue, 30 Oct 2018 18:57:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1540908210; x=1572444210; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=G4zIosFtXo/98gyoErMxEDLZDLGCkrMqqnKjqadTc00=; b=BQkTmNr4XhopUTFGUjy5x4HI3Wc1G6KFYHm4JsTkmmRgRpzaS8RPWq+7 bJazTZVhqaBkZAaTBKBwjh827xG5C5n0WFeU24PD1E/CEWf8kpBjx4Y6J pvzONVm1+dwhEx6hcNwzj7c5lV8AUj1xjmow9R/znbQ4NjoFWUFlFuhJr k=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2EaAACkY9hbhyWd50NkHAEBAQQBAQcEAQGBUgYBAQsBg2kojG2kZoF6CwEBhGwCgyUiNQwNAQMBAQIBAQIBAQIQAQEBCgsJCCkvgjYigmQCAQMSZxBRVwcSIoJ/ggKdFgKBEIlYAQEBghuFPIRqh0GEJoFYP4ERjWsCnxAHAoISBI5mCxiQSCyWUwIEAgQFAhSBRQGCCzMaI4M8giYOCY42U4t4AQE X-IPAS-Result: A2EaAACkY9hbhyWd50NkHAEBAQQBAQcEAQGBUgYBAQsBg2kojG2kZoF6CwEBhGwCgyUiNQwNAQMBAQIBAQIBAQIQAQEBCgsJCCkvgjYigmQCAQMSZxBRVwcSIoJ/ggKdFgKBEIlYAQEBghuFPIRqh0GEJoFYP4ERjWsCnxAHAoISBI5mCxiQSCyWUwIEAgQFAhSBRQGCCzMaI4M8giYOCY42U4t4AQE Received: from mx0b-00154901.pphosted.com ([67.231.157.37]) by esa4.dell-outbound.iphmx.com with ESMTP/TLS/AES256-SHA256; 30 Oct 2018 09:03:29 -0500 Received: from pps.filterd (m0089483.ppops.net [127.0.0.1]) by mx0b-00154901.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w9UDxd7N131543 for ; Tue, 30 Oct 2018 10:03:28 -0400 Received: from esa5.dell-outbound2.iphmx.com (esa5.dell-outbound2.iphmx.com [68.232.153.203]) by mx0b-00154901.pphosted.com with ESMTP id 2nerp1r117-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 30 Oct 2018 10:03:28 -0400 Received: from mailuogwhop.emc.com ([168.159.213.141]) by esa5.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA256; 30 Oct 2018 19:58:23 +0600 Received: from maildlpprd06.lss.emc.com (maildlpprd06.lss.emc.com [10.253.24.38]) by mailuogwprd03.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id w9UDwKNS012378 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 30 Oct 2018 09:58:24 -0400 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd03.lss.emc.com w9UDwKNS012378 Received: from mailsyshubprd06.lss.emc.com (mailsyshubprd06.lss.emc.com [10.253.24.24]) by maildlpprd06.lss.emc.com (RSA Interceptor); Tue, 30 Oct 2018 09:57:56 -0400 Received: from hopcyc-boyera-1-00.cec.lab.emc.com (hopcyc-boyera-1-00.cec.lab.emc.com [10.244.196.91]) by mailsyshubprd06.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id w9UDseSM028002; Tue, 30 Oct 2018 09:57:56 -0400 From: Andrew Boyer To: monis@mellanox.com, yonatanc@mellanox.com, linux-rdma@vger.kernel.org Cc: Andrew Boyer Subject: [PATCH 2/4] RDMA/rxe: Don't check for NULL before calling kfree_skb() Date: Tue, 30 Oct 2018 09:54:25 -0400 Message-Id: <20181030135427.19036-3-andrew.boyer@dell.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20181030135427.19036-1-andrew.boyer@dell.com> References: <20181030135427.19036-1-andrew.boyer@dell.com> X-RSA-Classifications: public X-Sentrion-Hostname: mailuogwprd03.lss.emc.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-10-30_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 mlxlogscore=793 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810300122 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 kfree_skb() already handles the case in which skb is NULL. Signed-off-by: Andrew Boyer Reviewed-by: Majd Dibbiny Reviewed-by: Zhu Yanjun --- drivers/infiniband/sw/rxe/rxe_recv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_recv.c b/drivers/infiniband/sw/rxe/rxe_recv.c index 08ad9dc72205..26e82f5fb4cb 100644 --- a/drivers/infiniband/sw/rxe/rxe_recv.c +++ b/drivers/infiniband/sw/rxe/rxe_recv.c @@ -328,8 +328,7 @@ static void rxe_rcv_mcast_pkt(struct rxe_dev *rxe, struct sk_buff *skb) rxe_drop_ref(mcg); /* drop ref from rxe_pool_get_key. */ err1: - if (skb) - kfree_skb(skb); + kfree_skb(skb); } static int rxe_match_dgid(struct rxe_dev *rxe, struct sk_buff *skb)