From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1121BC433E4 for ; Thu, 16 Jul 2020 03:09:00 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DBAEE20775 for ; Thu, 16 Jul 2020 03:08:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="FG/kfdhr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DBAEE20775 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 572158A675; Thu, 16 Jul 2020 03:08:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dFu5InlTkpAt; Thu, 16 Jul 2020 03:08:56 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id C75108A60E; Thu, 16 Jul 2020 03:08:56 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 6F5DF1BF3AF for ; Thu, 16 Jul 2020 03:08:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6BBEB88AF5 for ; Thu, 16 Jul 2020 03:08:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id x-6RmSJ8Bq_U for ; Thu, 16 Jul 2020 03:08:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by fraxinus.osuosl.org (Postfix) with ESMTPS id DA02D88AE6 for ; Thu, 16 Jul 2020 03:08:53 +0000 (UTC) Received: by mail-pj1-f67.google.com with SMTP id t15so3965173pjq.5 for ; Wed, 15 Jul 2020 20:08:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PQ3rS81iCqlQj563UE75aUsx51oFdKIvno+SEEG/FG4=; b=FG/kfdhrrvpgKNO8XoFAw8rMldsyko1xxMQvI4cYzTokOwgJ4VoV67Xp7ZSUwQyuB1 pUGFqZBMP6lpP24GnUWphnxjAPTHxBvHDhawoWy2aIc23UsRgkac0gYVUKAPjXZwMzVH C32IKdA7MiHJNt49J80WqSESe08lPvA2ln4BQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PQ3rS81iCqlQj563UE75aUsx51oFdKIvno+SEEG/FG4=; b=E2NG+GqeqCD8BDEysjS3FjI9TJLdJeUoHxxKPTBChw/OuGpILGh7mwsc+FvHVQ/7cC 36EZLkiUuQvCLehEn9gGUxClg5BuP049MJO2nSnFkO9dPreMW/Xom+HUya8HZV0jSPR1 RlLeBZ9fp3tx7DhKTdEdp5hO5McXVcAPrAOZFPe2ZWHDCPGgdFIN+hYjJfDo0u66s/OU b2chWvNOa21T2pob1ex+jxerTC4dLpu/DEVmwOo2RBhRFbqtNjUo17GB5+J4sazES8fV 49W8U1w1UmYcnd5bXyy5fFg4BnbyJYkbJSpu3Hi7KuAeVQ2h14033+eMD4+qwU/KOjac xaUw== X-Gm-Message-State: AOAM532CuDzHURReRqKEGc63HS/Fw8w8z9dH8mkr7fJgr4MzEFoxO0+L yLQGPD1GKODQ59qQ9YbbcKPnHw== X-Google-Smtp-Source: ABdhPJyQqOXVFa0AWxv/APlQyrdA+w7DqHfNJLE5LIIILIY1tjbP6/hW3QXi5M1V5H9nUHof0O9/lw== X-Received: by 2002:a17:902:6181:: with SMTP id u1mr1929724plj.205.1594868933459; Wed, 15 Jul 2020 20:08:53 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id q20sm3015469pfn.111.2020.07.15.20.08.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 20:08:51 -0700 (PDT) From: Kees Cook To: Greg Kroah-Hartman Subject: [PATCH 1/3] usb: gadget: udc: Avoid tasklet passing a global Date: Wed, 15 Jul 2020 20:08:45 -0700 Message-Id: <20200716030847.1564131-2-keescook@chromium.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716030847.1564131-1-keescook@chromium.org> References: <20200716030847.1564131-1-keescook@chromium.org> MIME-Version: 1.0 X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kuppuswamy Sathyanarayanan , "Rafael J. Wysocki" , Oscar Carter , Mitchell Blank Jr , kernel-hardening@lists.openwall.com, Peter Zijlstra , kgdb-bugreport@lists.sourceforge.net, Sebastian Andrzej Siewior , alsa-devel@alsa-project.org, Allen Pais , Christian Gromm , Will Deacon , devel@driverdev.osuosl.org, Jonathan Corbet , Daniel Thompson , "David S. Miller" , Masahiro Yamada , Takashi Iwai , Julian Wiedmann , "Matthew Wilcox \(Oracle\)" , Christian Borntraeger , Nishka Dasgupta , Jiri Slaby , Jakub Kicinski , Guenter Roeck , Wambui Karuga , Kees Cook , Vasily Gorbik , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Heiko Carstens , linux-input@vger.kernel.org, Ursula Braun , Stephen Boyd , Chris Packham , Harald Freudenberger , Thomas Gleixner , Jaroslav Kysela , Felipe Balbi , Kyungtae Kim , netdev@vger.kernel.org, Dmitry Torokhov , Douglas Anderson , Kevin Curtis , linux-usb@vger.kernel.org, Jason Wessel , Romain Perier , Karsten Graul Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" 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 --- 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 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel