[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180714055816.223754-7-toddpoynor@gmail.com>
Date: Fri, 13 Jul 2018 22:58:04 -0700
From: Todd Poynor <toddpoynor@...il.com>
To: Rob Springer <rspringer@...gle.com>,
John Joseph <jnjoseph@...gle.com>,
Ben Chan <benchan@...omium.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Zhongze Hu <frankhu@...omium.org>, Simon Que <sque@...omium.org>,
Dmitry Torokhov <dtor@...omium.org>,
Guenter Roeck <groeck@...omium.org>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
Todd Poynor <toddpoynor@...gle.com>
Subject: [PATCH 06/18] staging: gasket: fix deadlock in pci driver unregister path
From: Todd Poynor <toddpoynor@...gle.com>
g_mutex held across pci_unregister_driver() call, also held in
gasket_pci_remove(), which deadlocks.
Reported-by: Dmitry Torokhov <dtor@...omium.org>
Signed-off-by: Zhongze Hu <frankhu@...omium.org>
Signed-off-by: Todd Poynor <toddpoynor@...gle.com>
---
drivers/staging/gasket/gasket_core.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c
index 3bdf7d36b397..6d240dc59557 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -668,13 +668,10 @@ static void gasket_pci_remove(struct pci_dev *pci_dev)
struct gasket_dev *gasket_dev = NULL;
const struct gasket_driver_desc *driver_desc;
/* Find the device desc. */
- mutex_lock(&g_mutex);
+ __must_hold(&g_mutex);
internal_desc = lookup_internal_desc(pci_dev);
- if (!internal_desc) {
- mutex_unlock(&g_mutex);
+ if (!internal_desc)
return;
- }
- mutex_unlock(&g_mutex);
driver_desc = internal_desc->driver_desc;
--
2.18.0.203.gfac676dfb9-goog
Powered by blists - more mailing lists