mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: Feras Daoud <ferasda@mellanox.com>,
	Erez Shitrit <erezsh@mellanox.com>,
	Leon Romanovsky <leon@kernel.org>,
	Doug Ledford <dledford@redhat.com>,
	"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Subject: [PATCH AUTOSEL for 3.18 15/15] IB/ipoib: Change list_del to list_del_init in the tx object
Date: Wed, 25 Oct 2017 01:56:31 +0000	[thread overview]
Message-ID: <20171025015622.24698-15-alexander.levin@verizon.com> (raw)
In-Reply-To: <20171025015622.24698-1-alexander.levin@verizon.com>

From: Feras Daoud <ferasda@mellanox.com>

[ Upstream commit 27d41d29c7f093f6f77843624fbb080c1b4a8b9c ]

Since ipoib_cm_tx_start function and ipoib_cm_tx_reap function
belong to different work queues, they can run in parallel.
In this case if ipoib_cm_tx_reap calls list_del and release the
lock, ipoib_cm_tx_start may acquire it and call list_del_init
on the already deleted object.
Changing list_del to list_del_init in ipoib_cm_tx_reap fixes the problem.

Fixes: 839fcaba355a ("IPoIB: Connected mode experimental support")
Signed-off-by: Feras Daoud <ferasda@mellanox.com>
Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
Reviewed-by: Alex Vesker <valex@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/infiniband/ulp/ipoib/ipoib_cm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index cdf0a78e0c99..d88f8dbe62d9 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -1362,7 +1362,7 @@ static void ipoib_cm_tx_reap(struct work_struct *work)
 
 	while (!list_empty(&priv->cm.reap_list)) {
 		p = list_entry(priv->cm.reap_list.next, typeof(*p), list);
-		list_del(&p->list);
+		list_del_init(&p->list);
 		spin_unlock_irqrestore(&priv->lock, flags);
 		netif_tx_unlock_bh(dev);
 		ipoib_cm_tx_destroy(p);
-- 
2.11.0

      parent reply	other threads:[~2017-10-25  2:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-25  1:56 [PATCH AUTOSEL for 3.18 01/15] video: fbdev: pmag-ba-fb: Remove bad `__init' annotation Levin, Alexander (Sasha Levin)
2017-10-25  1:56 ` [PATCH AUTOSEL for 3.18 02/15] xen/netback: set default upper limit of tx/rx queues to 8 Levin, Alexander (Sasha Levin)
2017-10-25  1:56 ` [PATCH AUTOSEL for 3.18 06/15] iio: trigger: free trigger resource correctly Levin, Alexander (Sasha Levin)
2017-10-25  1:56 ` [PATCH AUTOSEL for 3.18 05/15] ARM: omap2plus_defconfig: Fix probe errors on UARTs 5 and 6 Levin, Alexander (Sasha Levin)
2017-10-25  1:56 ` [PATCH AUTOSEL for 3.18 04/15] drm: drm_minor_register(): Clean up debugfs on failure Levin, Alexander (Sasha Levin)
2017-10-25  1:56 ` [PATCH AUTOSEL for 3.18 03/15] ARM: dts: imx53-qsb-common: fix FEC pinmux config Levin, Alexander (Sasha Levin)
2017-10-25  1:56 ` [PATCH AUTOSEL for 3.18 10/15] serial: sh-sci: Fix register offsets for the IRDA serial port Levin, Alexander (Sasha Levin)
2017-10-25  1:56 ` [PATCH AUTOSEL for 3.18 07/15] dt-bindings: Add LEGO MINDSTORMS EV3 compatible specification Levin, Alexander (Sasha Levin)
2017-10-25  1:56 ` [PATCH AUTOSEL for 3.18 09/15] phy: increase size of MII_BUS_ID_SIZE and bus_id Levin, Alexander (Sasha Levin)
2017-10-25  1:56 ` [PATCH AUTOSEL for 3.18 08/15] dt-bindings: Add vendor prefix for LEGO Levin, Alexander (Sasha Levin)
2017-10-25  1:56 ` [PATCH AUTOSEL for 3.18 12/15] IPsec: do not ignore crypto err in ah4 input Levin, Alexander (Sasha Levin)
2017-10-25  1:56 ` [PATCH AUTOSEL for 3.18 11/15] usb: hcd: initialize hcd->flags to 0 when rm hcd Levin, Alexander (Sasha Levin)
2017-10-25  1:56 ` [PATCH AUTOSEL for 3.18 14/15] Input: mpr121 - set missing event capability Levin, Alexander (Sasha Levin)
2017-10-25  1:56 ` [PATCH AUTOSEL for 3.18 13/15] Input: mpr121 - handle multiple bits change of status register Levin, Alexander (Sasha Levin)
2017-10-25  1:56 ` Levin, Alexander (Sasha Levin) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171025015622.24698-15-alexander.levin@verizon.com \
    --to=alexander.levin@verizon.com \
    --cc=dledford@redhat.com \
    --cc=erezsh@mellanox.com \
    --cc=ferasda@mellanox.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®