Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2020546imm; Thu, 24 May 2018 04:38:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrYCHuVZ4pcX73PrCTs8Tobkyz465x0RYbcPzXu+G1ZkBs8vmnljdQjzVB3UN7trH4+78uD X-Received: by 2002:a17:902:7c94:: with SMTP id y20-v6mr7017814pll.202.1527161916711; Thu, 24 May 2018 04:38:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527161916; cv=none; d=google.com; s=arc-20160816; b=xcm4WgGUG8kqBNHTtsg7RYs5BeebW0he1cnDcgHxeM2K1VgbRJeV/PpbaVjmQy0K7y eKGPcOQeWNYWAjqEMzZ3fRbC/iOO6QSEZ7AJxMx9bf43UoT3rkaTURtONEe+r8q2Rcmc PeQiSyk03aARlPvSvcmpOlfDhi5tKbK92gAdQbC86Y1YRuo2Kb+TrzpvjCaxUb53mydn zI7Rl/JYJ61CIgqwDtg2TKrs/Mrin1r13b7VUgAY6nju+3gNIbbaiQXK5dNAt2qNsLhT WiZSTMPGbUXfIZpgfhCunYNJda0CFiQ8hx5M5+Vp5bTXMRPFUL5/OzKyHdxSi/4Wcj3s apkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=CVlyoyJYTevkSukK5ng0HcXpOHteRREbrfaA19CKk5c=; b=yjG5aM2FWIW1B32T81Aq5hciTBErB7gBKUiNvXwsqADUk3Hpnqi8cEapk894FOV6vu b7dl9jJlUuhDFW6wwQMiHUVl89BHBWCm4udQdUx7hj+l3C6CD3oXLTP5Ryw/S7t86z1Y 0chXEFTjKbjglkVX4DCHC55wtSo36MLZbHwQiUDhl7k+77vBvz340J8LFyE1uGBh1r5X hw4pcsXOCOD+RcIrWwBEYEkKbMjC7GxE8nTXlSMc89pa0VSaE5AFiVoNbtdTKKX7G+FZ lWQtUIUxWwU9+j9AWt2ApnTc0OReYaYPCxOMbN4jrhlOrswcswp7HB5G/n+ydHZYyz2J +hoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UvVbuzx4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33-v6si21428947plu.385.2018.05.24.04.38.21; Thu, 24 May 2018 04:38:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UvVbuzx4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033159AbeEXLhq (ORCPT + 99 others); Thu, 24 May 2018 07:37:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:38282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967393AbeEXJtb (ORCPT ); Thu, 24 May 2018 05:49:31 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 00C3F20847; Thu, 24 May 2018 09:49:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155370; bh=n7gAZ1il/UH78jiN5gxpPeMMYRKjFYzM5y1Tvf2Sxec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UvVbuzx42acmepqCAC5nvok7O4jxTfg0iGIKYHCdWaKOGvx77r8l3NDaIbE4RogOL FrjrUNYR7S4EWk2GAYH9eBLf2s9OcSq4Uuz9MCrXWPiu1FFbVYDI8hzcopw1muyhe/ +r+08IJp7+qgMKMZtbfkB1tE6mXkGVhGzleoewDw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Agner , Felipe Balbi , Sasha Levin Subject: [PATCH 4.9 28/96] usb: gadget: fsl_udc_core: fix ep valid checks Date: Thu, 24 May 2018 11:38:11 +0200 Message-Id: <20180524093607.185179302@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093605.602125311@linuxfoundation.org> References: <20180524093605.602125311@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stefan Agner [ Upstream commit 20c63f4089cceab803438c383631963e34c4d8e5 ] Clang reports the following warning: drivers/usb/gadget/udc/fsl_udc_core.c:1312:10: warning: address of array 'ep->name' will always evaluate to 'true' [-Wpointer-bool-conversion] if (ep->name) ~~ ~~~~^~~~ It seems that the authors intention was to check if the ep has been configured through struct_ep_setup. Check whether struct usb_ep name pointer has been set instead. Signed-off-by: Stefan Agner Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/udc/fsl_udc_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/usb/gadget/udc/fsl_udc_core.c +++ b/drivers/usb/gadget/udc/fsl_udc_core.c @@ -1310,7 +1310,7 @@ static void udc_reset_ep_queue(struct fs { struct fsl_ep *ep = get_ep_by_pipe(udc, pipe); - if (ep->name) + if (ep->ep.name) nuke(ep, -ESHUTDOWN); } @@ -1698,7 +1698,7 @@ static void dtd_complete_irq(struct fsl_ curr_ep = get_ep_by_pipe(udc, i); /* If the ep is configured */ - if (curr_ep->name == NULL) { + if (!curr_ep->ep.name) { WARNING("Invalid EP?"); continue; }