Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1343079ybp; Thu, 17 Oct 2019 11:20:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/y2JMFQ0AEJg6M2p8p0mciF1U37XNgKIQTXXGv6LxfSsPcCjxXsRJqRRqpi7jLwZjvO7G X-Received: by 2002:a17:906:480a:: with SMTP id w10mr4856771ejq.212.1571336423007; Thu, 17 Oct 2019 11:20:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571336422; cv=none; d=google.com; s=arc-20160816; b=g9p0Lm5LAOMIvmHr1+VAA4G1rGallVW9LUVW9X4v9V9M4WjHqXJ2H/n7yB9rpx1SDk XXa4I38dswn48om5h5SVaggTSyDsORFqwHrnqn19gzRIaMz7qi7SckaPW2luaK/8lVpm iKgWOviWb3NRGOCCsY5Jvs66fYgE9d8kmYAFsW5zkzjSO8+btTMP2JzZrfvhmcwoMpxv B1nkVZfmNSmtwy7fhYNB3s59FU1DMReM7q0YqK2QOTHophZMPMNHquKzqzKON24Q29Ug AU+Hd/lkTfw7mp44oKl37YL81CygQ3Gu5ICaaEQ3bDWxTaSDagjmdWNCLvzjKyFlnZKE 18Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MWKTkoC6jYE0PWRVC0I75x+3EZZnay8dRv0R2cIMB4s=; b=KHtjAUzkc/55/O4Vyp/EuQQcaNFG7UKIKcnk3Tbs8LPkYUfXYh1jY7EyMfK2VM9/Ts r2lnse1vOMem1OWmXuN+ltTKLnb/pMafo2KRoZ8hSBYjRYCf4FwmEQPyfktRHTbBORNP NUnaJuy9OfKhBNPKeprtfxFCXAVyBGk0FtE5RU655VMVHiPxl2ovHP/4iEFUZbhVaKX5 nRgG/TcZwM3CRKDZbS31llc8VrRzuO852cBciqEmhDRt+GyFfwQWFomRDnth8DbWU4xq XYcDlDKItqZnk+A5BSZxClpjxC1RourT1W0WM3ekD6LN5T7gVvTXETBNQH1DVdLy1Scc 3P4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QA8jDgC4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v53si2175311edc.378.2019.10.17.11.19.59; Thu, 17 Oct 2019 11:20:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QA8jDgC4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438739AbfJPWAT (ORCPT + 99 others); Wed, 16 Oct 2019 18:00:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:53674 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391472AbfJPV7M (ORCPT ); Wed, 16 Oct 2019 17:59:12 -0400 Received: from localhost (unknown [192.55.54.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5DACD21A4C; Wed, 16 Oct 2019 21:59:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571263151; bh=O8OYVUjvIYMQTnJDCWIIrkclgQg7z0kTSL1toBZGUww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QA8jDgC44XYEVy0+dHDAJ51Va8tw5Jed+++0KatFYHTqVR+NKzFfXAF9uQrphU1mD 6Pps/m7PO1dfzNjYWTvVJzI67is081pmbw7iywr5GCD5yeLoEbwbrJvluLUNRxpb8G NH1mg+Q7r5yMBdCEjYX2xkQoJjkz0WWF4Bs5BuDA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mohamad Heib , Erez Alfasi , Leon Romanovsky , Jason Gunthorpe Subject: [PATCH 5.3 079/112] IB/core: Fix wrong iterating on ports Date: Wed, 16 Oct 2019 14:51:11 -0700 Message-Id: <20191016214904.411039483@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191016214844.038848564@linuxfoundation.org> References: <20191016214844.038848564@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mohamad Heib commit 1cbe866cbcb53338de33cf67262e73f9315a9725 upstream. rdma_for_each_port is already incrementing the iterator's value it receives therefore, after the first iteration the iterator is increased by 2 which eventually causing wrong queries and possible traces. Fix the above by removing the old redundant incrementation that was used before rdma_for_each_port() macro. Cc: Fixes: ea1075edcbab ("RDMA: Add and use rdma_for_each_port") Link: https://lore.kernel.org/r/20191002122127.17571-1-leon@kernel.org Signed-off-by: Mohamad Heib Reviewed-by: Erez Alfasi Signed-off-by: Leon Romanovsky Reviewed-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/core/security.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/infiniband/core/security.c +++ b/drivers/infiniband/core/security.c @@ -426,7 +426,7 @@ int ib_create_qp_security(struct ib_qp * int ret; rdma_for_each_port (dev, i) { - is_ib = rdma_protocol_ib(dev, i++); + is_ib = rdma_protocol_ib(dev, i); if (is_ib) break; }