Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200716030847.1564131-2-keescook@chromium.org>
Date: Wed, 15 Jul 2020 20:08:45 -0700
From: Kees Cook <keescook@...omium.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Kees Cook <keescook@...omium.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Allen Pais <allen.lkml@...il.com>,
	Oscar Carter <oscar.carter@....com>,
	Romain Perier <romain.perier@...il.com>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Kevin Curtis <kevin.curtis@...site.co.uk>,
	"David S. Miller" <davem@...emloft.net>,
	Jakub Kicinski <kuba@...nel.org>,
	Harald Freudenberger <freude@...ux.ibm.com>,
	Heiko Carstens <hca@...ux.ibm.com>,
	Vasily Gorbik <gor@...ux.ibm.com>,
	Christian Borntraeger <borntraeger@...ibm.com>,
	Jiri Slaby <jslaby@...e.com>,
	Felipe Balbi <balbi@...nel.org>,
	Jason Wessel <jason.wessel@...driver.com>,
	Daniel Thompson <daniel.thompson@...aro.org>,
	Douglas Anderson <dianders@...omium.org>,
	Mitchell Blank Jr <mitch@...oth.com>,
	Julian Wiedmann <jwi@...ux.ibm.com>,
	Karsten Graul <kgraul@...ux.ibm.com>,
	Ursula Braun <ubraun@...ux.ibm.com>,
	Jaroslav Kysela <perex@...ex.cz>,
	Takashi Iwai <tiwai@...e.com>,
	Christian Gromm <christian.gromm@...rochip.com>,
	Nishka Dasgupta <nishkadg.linux@...il.com>,
	Masahiro Yamada <masahiroy@...nel.org>,
	Stephen Boyd <swboyd@...omium.org>,
	"Matthew Wilcox (Oracle)" <willy@...radead.org>,
	Wambui Karuga <wambui.karugax@...il.com>,
	Guenter Roeck <linux@...ck-us.net>,
	Chris Packham <chris.packham@...iedtelesis.co.nz>,
	Kyungtae Kim <kt0755@...il.com>,
	Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>,
	Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
	"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
	Jonathan Corbet <corbet@....net>,
	Peter Zijlstra <peterz@...radead.org>,
	Will Deacon <will@...nel.org>,
	linux-input@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	netdev@...r.kernel.org,
	linux-s390@...r.kernel.org,
	devel@...verdev.osuosl.org,
	linux-usb@...r.kernel.org,
	kgdb-bugreport@...ts.sourceforge.net,
	alsa-devel@...a-project.org,
	kernel-hardening@...ts.openwall.com
Subject: [PATCH 1/3] usb: gadget: udc: Avoid tasklet passing a global

There's no reason for the tasklet callback to set an argument since it
always uses a global. Instead, use the global directly, in preparation
for converting the tasklet subsystem to modern callback conventions.

Signed-off-by: Kees Cook <keescook@...omium.org>
---
 drivers/usb/gadget/udc/snps_udc_core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/gadget/udc/snps_udc_core.c b/drivers/usb/gadget/udc/snps_udc_core.c
index 3fcded31405a..afdd28f332ce 100644
--- a/drivers/usb/gadget/udc/snps_udc_core.c
+++ b/drivers/usb/gadget/udc/snps_udc_core.c
@@ -96,9 +96,7 @@ static int stop_pollstall_timer;
 static DECLARE_COMPLETION(on_pollstall_exit);
 
 /* tasklet for usb disconnect */
-static DECLARE_TASKLET(disconnect_tasklet, udc_tasklet_disconnect,
-		(unsigned long) &udc);
-
+static DECLARE_TASKLET(disconnect_tasklet, udc_tasklet_disconnect, 0);
 
 /* endpoint names used for print */
 static const char ep0_string[] = "ep0in";
@@ -1661,7 +1659,7 @@ static void usb_disconnect(struct udc *dev)
 /* Tasklet for disconnect to be outside of interrupt context */
 static void udc_tasklet_disconnect(unsigned long par)
 {
-	struct udc *dev = (struct udc *)(*((struct udc **) par));
+	struct udc *dev = udc;
 	u32 tmp;
 
 	DBG(dev, "Tasklet disconnect\n");
-- 
2.25.1

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.