From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161369AbcA0VEY (ORCPT ); Wed, 27 Jan 2016 16:04:24 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:43513 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967895AbcA0Ujj (ORCPT ); Wed, 27 Jan 2016 15:39:39 -0500 From: Kamal Mostafa To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Alexey Khoroshilov , Mauro Carvalho Chehab , Kamal Mostafa Subject: [PATCH 4.2.y-ckt 194/268] [media] lirc_imon: do not leave imon_probe() with mutex held Date: Wed, 27 Jan 2016 12:34:15 -0800 Message-Id: <1453926929-17663-195-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453926929-17663-1-git-send-email-kamal@canonical.com> References: <1453926929-17663-1-git-send-email-kamal@canonical.com> X-Extended-Stable: 4.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know. ---8<------------------------------------------------------------ From: Alexey Khoroshilov commit b833d0df943d70682e288c38c96b8e7bfff4023a upstream. Commit af8a819a2513 ("[media] lirc_imon: simplify error handling code") lost mutex_unlock(&context->ctx_lock), so imon_probe() exits with the context->ctx_lock mutex acquired. The patch adds mutex_unlock(&context->ctx_lock) back. Found by Linux Driver Verification project (linuxtesting.org). Fixes: af8a819a2513 ("[media] lirc_imon: simplify error handling code") Signed-off-by: Alexey Khoroshilov Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Kamal Mostafa --- drivers/staging/media/lirc/lirc_imon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/media/lirc/lirc_imon.c b/drivers/staging/media/lirc/lirc_imon.c index 62ec9f7..45b6443 100644 --- a/drivers/staging/media/lirc/lirc_imon.c +++ b/drivers/staging/media/lirc/lirc_imon.c @@ -885,12 +885,14 @@ static int imon_probe(struct usb_interface *interface, vendor, product, ifnum, usbdev->bus->busnum, usbdev->devnum); /* Everything went fine. Just unlock and return retval (with is 0) */ + mutex_unlock(&context->ctx_lock); goto driver_unlock; unregister_lirc: lirc_unregister_driver(driver->minor); free_tx_urb: + mutex_unlock(&context->ctx_lock); usb_free_urb(tx_urb); free_rx_urb: -- 1.9.1