Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp499552yba; Mon, 1 Apr 2019 10:31:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8m75Qm4sjxHp9uqvBqQqBV3c2hljJbIlS0r/0LXitYwR5BGUNF35T28nTyzHssqT3Zt6t X-Received: by 2002:a17:902:968b:: with SMTP id n11mr58152535plp.118.1554139906522; Mon, 01 Apr 2019 10:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554139906; cv=none; d=google.com; s=arc-20160816; b=Ksbq05EBcbOLgcCxBlHKkPx3SW1VSy1evtQ2FWSlWDzYU4sxDQ8q91GMtwL+Nk+JiQ bVMT4iXq0jk9tYHLQhQ/j5chH3S+lh6n1381TKuEcMu68lFj1EgPSoPQ0X4yh0tmBkut fycfhITrYLwRSo4jq5a6OR8fI5c1clkomv6ALPTNSaDMAcbLsaUKc3GFaMY6eyIPlDjO zAaLhrosRZUW2S1djOS0QNyHYUvHR/1SYK+MB5EPQocOyBYOb3/bAfYHNahKgDCxCkV7 UgDj0LLqgRh9Y5CNaeAXTh4uk2LHFME5GWsXBz+yxc5EmIfHdhjHbznORIvut2caXkaJ u/Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=51SUB4QfiNePDz6kCrGmKL9EfngCuDRemSgPmZS/S6g=; b=deSldMBcPgwchMqX39GVOlcOswR4wRl/dJobgr9RqjBZYvHZzOmcjLpJjPmxlpDxru TJoxj7IIbSMopYKYk4WJmmlZHB102sTGDGbd7a4kUbjmbp5eQgRE+LlTIX4wE9jXzYv0 1W6uQEeg9bR+P1GuoNcYXwwHXqHKAWFdTmh97KduM5699O3gObkMtPEweAYV+jdFlAQS XW97+NHB+hn5gsw391na2lb9gpBpf2CO0Nf4Woilmn8IlAt5y/EnHzXj+fE0tV2J5MMQ E75lJYjvR2LfCzucrA9jlAr4dqo9KuJv3I+PQdrPOxicHYN9LtANg1eZiyLhsCO5mmtO 2hBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2HqnSMcJ; 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 g20si9390832pfg.207.2019.04.01.10.31.31; Mon, 01 Apr 2019 10:31:46 -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=2HqnSMcJ; 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 S1733171AbfDARa6 (ORCPT + 99 others); Mon, 1 Apr 2019 13:30:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:38118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732784AbfDARay (ORCPT ); Mon, 1 Apr 2019 13:30:54 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 890AF2070B; Mon, 1 Apr 2019 17:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554139854; bh=PNFazyxEjwb7Gdp52eZKFEcjJtDugp3KrofG+yv+/gs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2HqnSMcJZTzF9SS6K4ghJK2u4AVAaC4B36Y7rOtajtsMbbbiwgB9VM57oySFASqsD CrLVyeGd6Ru2eAwmX8ba7SWlfR0G+RiebBX307qc5HXvHJFq9PCSXd2wsGijR04cyR NXZcStq1TIFFYxzO2qFQFwbN9bcyMDgbxupwrzLo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yoshihiro Shimoda , Felipe Balbi Subject: [PATCH 4.4 032/131] usb: renesas_usbhs: gadget: fix unused-but-set-variable warning Date: Mon, 1 Apr 2019 19:01:42 +0200 Message-Id: <20190401170054.777398553@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190401170051.645954551@linuxfoundation.org> References: <20190401170051.645954551@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yoshihiro Shimoda commit b7d44c36a6f6d956e1539e0dd42f98b26e5a4684 upstream. The commit b8b9c974afee ("usb: renesas_usbhs: gadget: disable all eps when the driver stops") causes the unused-but-set-variable warning. But, if the usbhsg_ep_disable() will return non-zero value, udc/core.c doesn't clear the ep->enabled flag. So, this driver should not return non-zero value, if the pipe is zero because this means the pipe is already disabled. Otherwise, the ep->enabled flag is never cleared when the usbhsg_ep_disable() is called by the renesas_usbhs driver first. Fixes: b8b9c974afee ("usb: renesas_usbhs: gadget: disable all eps when the driver stops") Fixes: 11432050f070 ("usb: renesas_usbhs: gadget: fix NULL pointer dereference in ep_disable()") Signed-off-by: Yoshihiro Shimoda Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/renesas_usbhs/mod_gadget.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c @@ -641,14 +641,11 @@ static int usbhsg_ep_disable(struct usb_ struct usbhsg_uep *uep = usbhsg_ep_to_uep(ep); struct usbhs_pipe *pipe; unsigned long flags; - int ret = 0; spin_lock_irqsave(&uep->lock, flags); pipe = usbhsg_uep_to_pipe(uep); - if (!pipe) { - ret = -EINVAL; + if (!pipe) goto out; - } usbhsg_pipe_disable(uep); usbhs_pipe_free(pipe);