nfc_nfc_free unlink clients from the device list
and has to be called under mei mutex

Signed-off-by: Tomas Winkler <[email protected]>
Reviewed-by: Alexander Usyskin <[email protected]>
---
 drivers/misc/mei/nfc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/misc/mei/nfc.c b/drivers/misc/mei/nfc.c
index 0a89220..5496190 100644
--- a/drivers/misc/mei/nfc.c
+++ b/drivers/misc/mei/nfc.c
@@ -469,7 +469,9 @@ static void mei_nfc_init(struct work_struct *work)
        return;
 
 err:
+       mutex_lock(&dev->device_lock);
        mei_nfc_free(ndev);
+       mutex_unlock(&dev->device_lock);
 
        return;
 }
-- 
1.8.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to