From patchwork Mon Nov 14 17:44:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Peter X-Patchwork-Id: 625056 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEDABC4332F for ; Mon, 14 Nov 2022 17:44:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237423AbiKNRoz (ORCPT ); Mon, 14 Nov 2022 12:44:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237395AbiKNRoy (ORCPT ); Mon, 14 Nov 2022 12:44:54 -0500 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2D7125C0; Mon, 14 Nov 2022 09:44:53 -0800 (PST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 690E75C00ED; Mon, 14 Nov 2022 12:44:53 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 14 Nov 2022 12:44:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svenpeter.dev; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm1; t=1668447893; x=1668534293; bh=vMxy/5Ep6z 8xTyah49JP7LX4W4hXdf9xwgHuikKY72M=; b=gLtoIFASX/fLQRLrI/h9jTax7p O/KAJ5C/fsKgbWyMcl7cxPio9Xs6o1i+kFeireANe2+loloq+rE45tpRhrLJl+8t nseMb0RGXgBToUHBg6vwnLxt3WfEQW47oqT0j8sU8od4WwcXGASUDsPDpPlU9Rpg w7sxkssw52zxtULaVVcgJsply9Mtp5ReJAPPZ7tPopQzd98vEibRNrxX5/kH2P1V rc+XNeL04umtrtkIl5l8eSjbuHHOgX7gRLz7yTyRZ6hIMQKb3U/xtVWgQCiYIoN7 43Rj41gh/zNHGJ1HphUsgX7JWuWHkkUmC1ajBFjsTG21P6ImhBIH2Y/MlYfw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1668447893; x=1668534293; bh=vMxy/5Ep6z8xTyah49JP7LX4W4hXdf9xwgH uikKY72M=; b=cJhN3xTuNzHHKgf96QzXN+EEIlg/JxLrzBGuuJPUk0ZTrmsbIW+ koz/jtenzfIifmLKnL9DxZviRsZhehyMvcNapMykOPONVeuQ71foudGItvXLMpQZ DFK55X5D2+Xbi0MB1GeK55GSmvhM3GAGjoOAVJYmJIvqgv2v7Ft4oRPy39hw4RZb mEjclqv0eOGATCwkoP7VlOjWcIwHdGeGaR7s+q79sAvDgNNHQS88ph0AjkOMJxh7 CXZPHNaUv2cuXMv6zREocLcbR3a/XQ9h2xKe6A6mZqbCUp3JfYLrnzEVSuVMa7qs gG+6JSfHYlHixg4YK3OtDf7oVk0urHLX96Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgedvgdejiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefuvhgvnhcurfgv thgvrhcuoehsvhgvnhesshhvvghnphgvthgvrhdruggvvheqnecuggftrfgrthhtvghrnh epleduffeiheeuvedtffevtdeuleeljeduudfgtedtvefhfeffvdfghfejhefgleelnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshhvvghnse hsvhgvnhhpvghtvghrrdguvghv X-ME-Proxy: Feedback-ID: i51094778:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 14 Nov 2022 12:44:52 -0500 (EST) From: Sven Peter To: Heikki Krogerus , Greg Kroah-Hartman Cc: Sven Peter , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] usb: typec: tipd: Cleanup resources if devm_tps6598_psy_register fails Date: Mon, 14 Nov 2022 18:44:46 +0100 Message-Id: <20221114174449.34634-1-sven@svenpeter.dev> X-Mailer: git-send-email 2.30.1 (Apple Git-130) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org We can't just return if devm_tps6598_psy_register fails since previous resources are not devres managed and have yet to be cleaned up. Fixes: 10eb0b6ac63a ("usb: typec: tps6598x: Export some power supply properties") Signed-off-by: Sven Peter --- drivers/usb/typec/tipd/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index 748ff4f6b5f6..ebc786d728e2 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -827,7 +827,7 @@ static int tps6598x_probe(struct i2c_client *client) ret = devm_tps6598_psy_register(tps); if (ret) - return ret; + goto err_role_put; tps->port = typec_register_port(&client->dev, &typec_cap); if (IS_ERR(tps->port)) {