From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C7D76F074; Wed, 21 Feb 2024 13:44:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708523054; cv=none; b=ulMCwI+Ip4in3FWp8qPNZd5ygU94GOujo+KOfQIZYGq4EuJD16BeuCIEls7/4ZUEvjE/tqH0qHg781iiWbGxWpOnwPRWcm+lRAX0CUf+Wx+KYNKu8/1ptwsO+9eDtHiVWTtFMUpM3sI6Bpgr/i5xEhCcd+DeIjlN0SC3W+DUqjU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708523054; c=relaxed/simple; bh=ukGeJR6QhregJD+vOO0hdCIsgZX0SWh4RuQaQ5RtXdw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=md6OlXwjHxbiE6T9x5qeWI3Jgz4f+2o3azTXMdWrAUrFo9ES6V1MfTz+kVjgq2MKlGvmdL8sVMfxC8lfG/mqRwwbvnnAw7FtOEvW1ph9zhn8oHAyGe6vSCSycuMhJDc5nH+yiCSSrOaNRDX6r9+J+3xPCW8WWjSPmIz1QgklTWU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=RJq3VnuQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="RJq3VnuQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC5BDC43394; Wed, 21 Feb 2024 13:44:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1708523054; bh=ukGeJR6QhregJD+vOO0hdCIsgZX0SWh4RuQaQ5RtXdw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RJq3VnuQe0sVNL6Cxgd3z/BOVMsEvzXBIthsD60gjBDJfsGQKs7W9pIRpYXos1I/M 2WZLZ7MMZAYFYpessV1a9TBRWauFga+0YkEpXkhQRNggr4I6Cz6Q8E1DmIFTaQp7fS tkVfmkhnk9cqaHrCbWerVjoNUPdfOHrJ/uLI+Gp0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, kernel test robot , Dan Carpenter , Yoshihiro Shimoda , Geert Uytterhoeven , Vinod Koul , Sasha Levin Subject: [PATCH 5.15 300/476] phy: renesas: rcar-gen3-usb2: Fix returning wrong error code Date: Wed, 21 Feb 2024 14:05:51 +0100 Message-ID: <20240221130019.088721507@linuxfoundation.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240221130007.738356493@linuxfoundation.org> References: <20240221130007.738356493@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yoshihiro Shimoda [ Upstream commit 249abaf3bf0dd07f5ddebbb2fe2e8f4d675f074e ] Even if device_create_file() returns error code, rcar_gen3_phy_usb2_probe() will return zero because the "ret" is variable shadowing. Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202312161021.gOLDl48K-lkp@intel.com/ Fixes: 441a681b8843 ("phy: rcar-gen3-usb2: fix implementation for runtime PM") Signed-off-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20240105093703.3359949-1-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/phy/renesas/phy-rcar-gen3-usb2.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/phy/renesas/phy-rcar-gen3-usb2.c b/drivers/phy/renesas/phy-rcar-gen3-usb2.c index 9de617ca9daa..7e61c6b278a7 100644 --- a/drivers/phy/renesas/phy-rcar-gen3-usb2.c +++ b/drivers/phy/renesas/phy-rcar-gen3-usb2.c @@ -675,8 +675,6 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev) channel->irq = platform_get_irq_optional(pdev, 0); channel->dr_mode = rcar_gen3_get_dr_mode(dev->of_node); if (channel->dr_mode != USB_DR_MODE_UNKNOWN) { - int ret; - channel->is_otg_channel = true; channel->uses_otg_pins = !of_property_read_bool(dev->of_node, "renesas,no-otg-pins"); @@ -740,8 +738,6 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev) ret = PTR_ERR(provider); goto error; } else if (channel->is_otg_channel) { - int ret; - ret = device_create_file(dev, &dev_attr_role); if (ret < 0) goto error; -- 2.43.0