Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1996900imm; Thu, 24 May 2018 04:14:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrplwgpQIXSSb2t5TYAK1lOSBFd2c7jByBNyGgOPSYgACXY3CxVfAPlYxiCBRxmLbmKHmTC X-Received: by 2002:a17:902:206:: with SMTP id 6-v6mr6849912plc.294.1527160468303; Thu, 24 May 2018 04:14:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527160468; cv=none; d=google.com; s=arc-20160816; b=ODUbBwna8cLmFhE9e+JZzSPRMpyZtC2V247hMnNkHm0pnNSRy1SDihS1jJ+4NBsrYp mjx7Ed3YCgDdKGWg07fZXz+E8LN8yxtyItGMA/pY8nDDNdw2ncpmkNjGDmYUEtpQhrsF epe/eFacY5F+LTuIcHeSoPtoJ/1zqPbtOzRpfJWohsTUcWFJkcYrx2LYCjDgJeCH/KfI fGMhP62dbLvQFTaKQY78MXWszKU3iBtMk5/tc3waSQoxlgrROajOOEJqJ2DEiYsjccoP TuU9QBGfruFZwXH6KJxJ7wY5JqhCtkhTozOacJDFrrOL5UuCzPfNsVTIVKCwHDNy+hx7 /ezw== 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=pGj8DST3WKy0akzw6REKetrVwht4gHuwyXX4dqrgbUQ=; b=rzjn5BLvIZTGRKK3I/H92e8oZc5mFbjPRVAs3yAlf2zrLdkhr08e5i/UmMJr3D6w4k leRFracotm/8JZy2CyOtYfuQ3Qopm4suvMLcQsO/as1tYhFpI+9mEv51Ef4GDfIROjaN RAKE8evOZl5bzTY5JnlJIm8SIDhyWc/Wj1yBJfXbHxGH4aWTzQ7UNnhtc47m7c0gBnNw zIzLSntgvCGAPCCiy7y/oLjREyPfBecgviTgXW1DE6yY+h1Z9NWsWEOHiNXo/u5/kS9I uGU9pxHJV45ZV21WeH1fJSxRmJjLxws3mIwnQM9/hZuYISJxxbd4rwetaZx5j5zOMc6x PIIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pmcPP+Fi; 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 p13-v6si3071084pgf.392.2018.05.24.04.14.13; Thu, 24 May 2018 04:14:28 -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=pmcPP+Fi; 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 S968132AbeEXJyK (ORCPT + 99 others); Thu, 24 May 2018 05:54:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:60654 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967783AbeEXJxp (ORCPT ); Thu, 24 May 2018 05:53:45 -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 C1E42208A0; Thu, 24 May 2018 09:53:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155625; bh=GJJ7PjLFF/HiWdwwl+H9GKQjDBSQ7J30F3W1ywigv6Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pmcPP+Fii6U8x2LtnsPPcQXAD4vCy+Y3OC+0keNswESTIOZdRgpgIP7WCDChJIi19 HAPE552+wDOPGbImtIDXntlMP5BxKPElrs6IfAq1GhDjXHBtGJu87/PTMAmrv0zWBx UhizaQyMMdOHPFlRYQrrzxD5zGAl4s15+IPKqY4w= 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.14 058/165] usb: gadget: fsl_udc_core: fix ep valid checks Date: Thu, 24 May 2018 11:37:44 +0200 Message-Id: <20180524093624.366302510@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@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.14-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 @@ -1309,7 +1309,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); } @@ -1697,7 +1697,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; }