From patchwork Mon May 7 17:23:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Boyer X-Patchwork-Id: 10384545 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 2D77060159 for ; Mon, 7 May 2018 17:25:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1422928683 for ; Mon, 7 May 2018 17:25:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 075FE28A87; Mon, 7 May 2018 17:25:04 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, 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 969DF28683 for ; Mon, 7 May 2018 17:25:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752494AbeEGRZC (ORCPT ); Mon, 7 May 2018 13:25:02 -0400 Received: from esa3.dell-outbound.iphmx.com ([68.232.153.94]:60307 "EHLO esa3.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752449AbeEGRZC (ORCPT ); Mon, 7 May 2018 13:25:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1525713362; x=1557249362; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=9vJsGT7vZPV0Zs/WK6UzR11AwggDfuAfLLLUtH1X12w=; b=lHvvc1HlecRXLuTpJWiJGCo5cDlTosiZCF7QuTYeZN/ueAuC2m9nJe4A zA8S70d5XSKuwrgI/vXdG8LDNYoORVs0T1x+NyWObiAceJp0wcsZSmhYn TUlGKDVSc63whKz/QYAXuwy7ox+OX7/kaawU7VJfNjqsZHw2Wqys9r0Nj Q=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2EbAQCmivBah8qZ6ERcGgEBAQEBAgEBA?= =?us-ascii?q?QEIAQEBAYUfKIxPjBaDCJMmgXgLhGwCglQhNhYBAgEBAQEBAQIBAQIQAQEBCgs?= =?us-ascii?q?JCCgvgjUiglQDAydSEFFXBxKFIapIM4RYg2uCSIglgVQ/gQ+CXYp1AocVkRUIg?= =?us-ascii?q?WWMaAKMYJAlAgQCBAUCFIElIweBfTMaI4MTgiAOCY4zU5BEAQE?= X-IPAS-Result: =?us-ascii?q?A2EbAQCmivBah8qZ6ERcGgEBAQEBAgEBAQEIAQEBAYUfKIx?= =?us-ascii?q?PjBaDCJMmgXgLhGwCglQhNhYBAgEBAQEBAQIBAQIQAQEBCgsJCCgvgjUiglQDA?= =?us-ascii?q?ydSEFFXBxKFIapIM4RYg2uCSIglgVQ/gQ+CXYp1AocVkRUIgWWMaAKMYJAlAgQ?= =?us-ascii?q?CBAUCFIElIweBfTMaI4MTgiAOCY4zU5BEAQE?= Received: from esa2.dell-outbound2.iphmx.com ([68.232.153.202]) by esa3.dell-outbound.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 May 2018 12:16:02 -0500 Received: from mailuogwdur.emc.com ([128.221.224.79]) by esa2.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 May 2018 23:19:15 +0600 Received: from maildlpprd56.lss.emc.com (maildlpprd56.lss.emc.com [10.106.48.160]) by mailuogwprd53.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id w47HOtVC007517 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 7 May 2018 13:24:59 -0400 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd53.lss.emc.com w47HOtVC007517 Received: from mailapphubprd53.lss.emc.com (emcmail.lss.emc.com [10.106.83.172]) by maildlpprd56.lss.emc.com (RSA Interceptor); Mon, 7 May 2018 13:24:34 -0400 Received: from hopcyc-boyera-1-00.cec.lab.emc.com (hopcyc-boyera-1-00.cec.lab.emc.com [10.244.196.91]) by mailapphubprd53.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id w47HNkRj015171; Mon, 7 May 2018 13:24:35 -0400 From: Andrew Boyer To: shiraz.saleem@intel.com, linux-rdma@vger.kernel.org Cc: Andrew Boyer Subject: [PATCH 2/3] RDMA/i40iw: Avoid reference leaks when processing the AEQ Date: Mon, 7 May 2018 13:23:37 -0400 Message-Id: <1525713818-5771-3-git-send-email-andrew.boyer@dell.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1525713818-5771-1-git-send-email-andrew.boyer@dell.com> References: <1525713818-5771-1-git-send-email-andrew.boyer@dell.com> X-RSA-Classifications: public X-Sentrion-Hostname: mailuogwprd53.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 In this switch there is a reference held on the QP. 'continue' will grab the next event without releasing the reference, causing a leak. Change it to 'break' to drop the reference before grabbing the next event. Fixes: 4e9042e647ff ("i40iw: add hw and utils files") Signed-off-by: Andrew Boyer Reviewed-by: Shiraz Saleem --- drivers/infiniband/hw/i40iw/i40iw_hw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/i40iw/i40iw_hw.c b/drivers/infiniband/hw/i40iw/i40iw_hw.c index 6139836..c9f62ca 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_hw.c +++ b/drivers/infiniband/hw/i40iw/i40iw_hw.c @@ -331,7 +331,7 @@ void i40iw_process_aeq(struct i40iw_device *iwdev) switch (info->ae_id) { case I40IW_AE_LLP_FIN_RECEIVED: if (qp->term_flags) - continue; + break; if (atomic_inc_return(&iwqp->close_timer_started) == 1) { iwqp->hw_tcp_state = I40IW_TCP_STATE_CLOSE_WAIT; if ((iwqp->hw_tcp_state == I40IW_TCP_STATE_CLOSE_WAIT) && @@ -360,7 +360,7 @@ void i40iw_process_aeq(struct i40iw_device *iwdev) break; case I40IW_AE_LLP_CONNECTION_RESET: if (atomic_read(&iwqp->close_timer_started)) - continue; + break; i40iw_cm_disconn(iwqp); break; case I40IW_AE_QP_SUSPEND_COMPLETE: