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 8DC1B1863 for ; Wed, 28 Dec 2022 15:15:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16F29C433EF; Wed, 28 Dec 2022 15:15:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1672240518; bh=MBw+4m148sjkCpRJcJqaBrrHpu2EVjEm0R6LTq4FONA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2emvKYdKKykZVHYJQwAwXqlHKiDVScywDVPfH09BgiEgkQjjwMpIkkUYuslXj4YxQ 1tRONCxb1nl6rWwI7mpQkWHiyZelrHi8TGrgljVONXtejM7y8kOHSqVVy1+TnAoUIH 1jb74WFhZWaiZPvwgLwEAYesqf/0PzR/jgZwhzAM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Prashant Malani , Tzung-Bi Shih , Sasha Levin Subject: [PATCH 6.0 0170/1073] platform/chrome: cros_ec_typec: Cleanup switch handle return paths Date: Wed, 28 Dec 2022 15:29:18 +0100 Message-Id: <20221228144332.631620861@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221228144328.162723588@linuxfoundation.org> References: <20221228144328.162723588@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Prashant Malani [ Upstream commit d5f66527db9e0e6a871d9005200b3394156cf16f ] Some of the return paths for the cros_typec_get_switch_handles() aren't necessary. Clean up the return paths to only undo the handle get's which succeeded. Signed-off-by: Prashant Malani Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220816214857.2088914-7-pmalani@chromium.org Stable-dep-of: 9a8aadcf0b45 ("platform/chrome: cros_ec_typec: zero out stale pointers") Signed-off-by: Sasha Levin --- drivers/platform/chrome/cros_ec_typec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c index dc5722db2066..fcfb98992920 100644 --- a/drivers/platform/chrome/cros_ec_typec.c +++ b/drivers/platform/chrome/cros_ec_typec.c @@ -159,12 +159,10 @@ static int cros_typec_get_switch_handles(struct cros_typec_port *port, return 0; role_sw_err: - usb_role_switch_put(port->role_sw); -ori_sw_err: typec_switch_put(port->ori_sw); -mux_err: +ori_sw_err: typec_mux_put(port->mux); - +mux_err: return -ENODEV; } -- 2.35.1