lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210802223703.GA1425480@pc>
Date:   Mon, 2 Aug 2021 23:37:03 +0100
From:   Salah Triki <salah.triki@...il.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Dan Carpenter <dan.carpenter@...cle.com>,
        Amey Narkhede <ameynarkhede03@...il.com>
Cc:     linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: [PATCH] staging: gdm724x: get lock before calling
 usb_[disable|enable]_autosuspend()

Based on the documentation of usb_[disable|enable]_autosuspend(), the
caller must hold udev's device lock.

Signed-off-by: Salah Triki <salah.triki@...il.com>
---
 drivers/staging/gdm724x/gdm_usb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/gdm724x/gdm_usb.c b/drivers/staging/gdm724x/gdm_usb.c
index 54bdb64f52e8..31b3b3e563c8 100644
--- a/drivers/staging/gdm724x/gdm_usb.c
+++ b/drivers/staging/gdm724x/gdm_usb.c
@@ -846,7 +846,9 @@ static int gdm_usb_probe(struct usb_interface *intf,
 	udev->intf = intf;
 
 	intf->needs_remote_wakeup = 1;
+	usb_lock_device(usbdev);
 	usb_enable_autosuspend(usbdev);
+	usb_unlock_device(usbdev);
 	pm_runtime_set_autosuspend_delay(&usbdev->dev, AUTO_SUSPEND_TIMER);
 
 	/* List up hosts with big endians, otherwise,
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ