Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2056034rdb; Tue, 3 Oct 2023 08:58:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzJTXcvs/AqLG0Y/UXT4sIXwQbbNCi8Oa/Ky2cLo1ZTbvY+ttFnyQkmvWLmonKWShUALfU X-Received: by 2002:a17:90a:b304:b0:276:696b:1dd9 with SMTP id d4-20020a17090ab30400b00276696b1dd9mr4869860pjr.15.1696348724424; Tue, 03 Oct 2023 08:58:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696348724; cv=none; d=google.com; s=arc-20160816; b=FE8xF0MjJyX+B+/dvdkLkv/RxGT7lEWgp4TMAjcBks37I+C1Y/VcsHO3kfApgK4STL xKkxAPOi0PiURmDKT5i3inl4WsCqb8mJAJB/dma04mEh5ImBt5P9XwdABCFDHSXyd/g0 ibaF21riE32g8C111gcXysPAOz6E76nEIsm8adhkzIkSefK7TX1QkoU4aPa7i2FD221+ eeLFKse/Q8QOoDGx14wcn11ND0n0aeARwq1G6u2G8NAkZCceJbsEjea3GUqWRXdkmYwD LGMbuIo9xQKBA+iRi+5ExnMG1vwX1M7CJmLhjuEVZlLkbjn10gEqniye8H6NEUc87i1U /uHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=kAIAL4K+fr6MvpNvW5PcjQacisSatXjKJI9jgtb5UHA=; fh=vXRfSyB7LiTsq43vn8YCJvcCfHVAADLiAEyFV5ba4w0=; b=YHBssfsiWYtNmzPjXJWdi3BZb8XowM69meFVE0OHNyHZCpkkV+0HiAhfjIqeoUyE2I WxmhUnRoAC5iIHhL6NjiXX+VZyvGgTmX0iqhJvUPQ6R3ySVjCMvRQeKVrqB5D8fwj3Bu WTBz8cPWEbasPsuOaLh5kBsS8vxpeLIdOqhbS5KoXaOLIXH6TwuZz4+854UJtrZ1lOJh S02o78IYrJphyAgX9FWr+uVsBdj9EdtItg053EQY2mkgz6gPeoRfw4kyMuitok6YOoJh x6RL6+9eRdLCjUQpylu20FtajlzScWMqwsIQjOp8KgVuxseFXHKWn4vThhwbZXk1zrry wvUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IBYUGpgV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id pf6-20020a17090b1d8600b00276c28cdd4fsi1896931pjb.31.2023.10.03.08.58.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 08:58:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IBYUGpgV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 95B8282BB1B6; Tue, 3 Oct 2023 08:58:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240111AbjJCP6k (ORCPT + 99 others); Tue, 3 Oct 2023 11:58:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232218AbjJCP6e (ORCPT ); Tue, 3 Oct 2023 11:58:34 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A61FAF for ; Tue, 3 Oct 2023 08:58:31 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0063C433C9; Tue, 3 Oct 2023 15:58:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696348710; bh=x4+F/ayjzolbI5Z0chsY8fDErsz5v4RnO2hda7AbeCk=; h=From:To:Cc:Subject:Date:From; b=IBYUGpgVFFgQoig5s2QW9LJjtYjJMW/WRBBlkYxbnXnMZ72pTEve2G2zYTs8NlzQC DMROuAtz1IOdXT2P7PH5FdCV2TyV7+4d+EQjSzOHLqYHZTd2v0m+wPGemgTuUu76+V DzsFOHEzOqMe9GBFpU+3L2CHK+MoMjTj72OQPe3km4ANp0YzfFJ++XYMhXZ8wWlyiM F3Oq2/pvgfp6fu79JHz3ushUpTm2PB7R06dNmYLJ0BqJJnrOzgNc5xV1XIWgYr7+B3 pXaj4vaMuVdbf4wYl6hR62AurNdj0Cy3OqHOzg6idqQCl6mCJSnW5UvTMnvyXrwNW2 UGGkHRPlmsqdA== Received: from johan by xi.lan with local (Exim 4.96) (envelope-from ) id 1qnhnF-00074l-2r; Tue, 03 Oct 2023 17:58:41 +0200 From: Johan Hovold To: Mark Brown Cc: Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Srinivas Kandagatla , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 0/7] ASoC: codecs: wcd938x: fix probe and bind error handling Date: Tue, 3 Oct 2023 17:55:51 +0200 Message-ID: <20231003155558.27079-1-johan+linaro@kernel.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 03 Oct 2023 08:58:43 -0700 (PDT) The wcd938x codec driver happily ignores error handling, something which has bitten us in the past when we hit a probe deferral: https://lore.kernel.org/lkml/20230705123018.30903-1-johan+linaro@kernel.org/ Fix up the remaining probe and component bind paths that left resources allocated and registered after errors to avoid similar future issues. Johan Johan Hovold (7): ASoC: codecs: wcd938x: drop bogus bind error handling ASoC: codecs: wcd938x: fix unbind tear down order ASoC: codecs: wcd938x: fix resource leaks on bind errors ASoC: codecs: wcd938x: fix regulator leaks on probe errors ASoC: codecs: wcd938x: fix runtime PM imbalance on remove ASoC: codecs: wcd938x-sdw: fix use after free on driver unbind ASoC: codecs: wcd938x-sdw: fix runtime PM imbalance on probe errors sound/soc/codecs/wcd938x-sdw.c | 27 +++++++++++- sound/soc/codecs/wcd938x.c | 76 +++++++++++++++++++++++++--------- 2 files changed, 83 insertions(+), 20 deletions(-) -- 2.41.0