Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp787902rwd; Mon, 12 Jun 2023 23:46:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4vA1crA8ctDrjRPFe0QyYqR1pHfbxw7VTLQewIL0ViS09ZilA6yHeyVfOJr2b5r0O9QfzI X-Received: by 2002:a05:6808:1a17:b0:39a:c1a0:7cbe with SMTP id bk23-20020a0568081a1700b0039ac1a07cbemr7413043oib.12.1686638794740; Mon, 12 Jun 2023 23:46:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686638794; cv=none; d=google.com; s=arc-20160816; b=ksSNKpOAzqm7Vbiq+qqYffqBba6UCfAU7kmb9NWfUWDS+zudJyjtAZh+FO28g/ZE6u mKzcSHNW2OUDmA8TO1I3yamyMiAtyvmGbCP8VIQ0avA2LUBKKOqJMOQkt2/Rr9LUaaaZ pi1bBlb6Yxl2K6Ogr6AWHbwdgym93RWZCvjFu3FjFvFwMfiZg/vHzVgSkXKRn/yxecpE o8BqHF1ZenFIRDghvlZbANAW2dN67VvtgOlFi9BRWsGiAzaacMf508jlPSlXeupjrhRz oB0pC/LaSYEYUSXhKBmiFFeKI+92MvTwLYEYWgBScH2kxiIt5ehtnZwrJFh2wLQ7xb/X Atqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=SksGVuYCcpsJS5jmOyFVtMmk7sbrZYWWYhHorGtkCYg=; b=itQXkm8qEmouUrsSLZJUbeoamUjYGa3tpfI63K7zbrdwg9PnOeyoEE7tpYMcDq1Uw/ tVU13wm6bwk2yYoyLVggpT/gykHV/j2BW8jA3E6ClLSgeOeveFC9tvCVBU0LghRYUvxB Ksprd4yDkPAXxuAZ9aKWOTNBIB7nGK+OAI/ru3QRQQCxe+GaSvNNtssO32h3B3HQ/K+5 mjGBWxo9u5/AparnPNQtBTYe2h07dmSgFQeBy3CrCKNVPKrpbXEwuzn1qKZbneW23XJP aOIu2mO+9nD8lCV5YKROd2mnWAGc3GBeNGLg2xcRRZHu749U5d8PsgVnCd/FuXO9uHi8 8YQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=Cvn1KURu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 19-20020a17090a199300b002476be78cd2si9971101pji.121.2023.06.12.23.46.22; Mon, 12 Jun 2023 23:46:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=Cvn1KURu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240090AbjFMGYN (ORCPT + 99 others); Tue, 13 Jun 2023 02:24:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240027AbjFMGYG (ORCPT ); Tue, 13 Jun 2023 02:24:06 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D73481711 for ; Mon, 12 Jun 2023 23:24:02 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-bb2fae9b286so6605352276.3 for ; Mon, 12 Jun 2023 23:24:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686637442; x=1689229442; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=SksGVuYCcpsJS5jmOyFVtMmk7sbrZYWWYhHorGtkCYg=; b=Cvn1KURuUQhom3FaKEax20iu/wRaoEiE+9IlyMWWIGvmYOydnM3Fbia3p3JYFkG+RA 79Kx39PwldBaXf9s3FZJRMs3Dxdn+VqpVnfMUNBTddetvkg5SuEx+Ourqz6HdUFX76WX kqB4YCKy1WOxSMSQ/HghElbCNBtlZAXc+2YXlpmAFddwrIO865Zjv5CnjDZUbKqA0Np7 uHVlrgjkSHMvsRKpgnXbRDRReCBmcYlgGVHF/KII5tQzwunuWWx0krZ2Z/Hmt7TQfRdg TgKKvc0ShTp2X83gkNhOLw5dm5ro1bozBtFfo7BHd8oUDDdPH+BQZOYe7aw3PBB1A2dk 83Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686637442; x=1689229442; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=SksGVuYCcpsJS5jmOyFVtMmk7sbrZYWWYhHorGtkCYg=; b=bpjMZ+xPyVMi3mdOSoM1H4VFXGmdpHKCriZQbI45yQx8SdkLvCpgtwlT7W2QU7CUsQ GR7/45RTRSDBtrZPGg1fWwHi5rSTQ0lGAyJJq0kL9y8EcbUbkLx6h6hLgBhWojARRCA7 TI5OehIrIOjR9Dlys68NUkbHLIElUUibkHwKxFkaNrbBHsjnC3htOhMzrTbpbebE8Qdl 3f+FaYvXrVXseXvtAwHeVMGSPr3022C8nVZiEoPjCCBAYMspx9q7GFb/XeUYpFIQHeV3 GWnPWKUdUF5zfLJi12Pi8T9cCQGPxvdoIySWm+22BUNyZtUShcUA4mSFUqfvsF6w4P0A 38Vg== X-Gm-Message-State: AC+VfDxpiXMoubxttbtIOm45Gj8QMwOaCZJrttf163THeWF+IuVQFWRN M6UkrFY/g20OKIsfDSbWZSZQFQxKsGnbyj+MEQ== X-Received: from yixuanjiang.ntc.corp.google.com ([2401:fa00:fc:202:8f9c:a67:3aa8:51ac]) (user=yixuanjiang job=sendgmr) by 2002:a25:ad1d:0:b0:bd1:ae45:5447 with SMTP id y29-20020a25ad1d000000b00bd1ae455447mr208027ybi.0.1686637442066; Mon, 12 Jun 2023 23:24:02 -0700 (PDT) Date: Tue, 13 Jun 2023 14:23:50 +0800 Mime-Version: 1.0 X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog Message-ID: <20230613062350.271107-1-yixuanjiang@google.com> Subject: [PATCH] ASoC: soc-compress: Fix deadlock in soc_compr_open_fe From: yixuanjiang To: vkoul@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, yixuanjiang , stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL 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 Modify the error handling flow by release lock. The require pcm_mutex will keep holding if open fail. Fixes: aa9ff6a4955f ("ASoC: soc-compress: Reposition and add pcm_mutex") Signed-off-by: yixuanjiang Cc: stable@vger.kernel.org # v5.15+ --- sound/soc/soc-compress.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index 256e45001f85..b6727b91dd85 100644 --- a/sound/soc/soc-compress.c +++ b/sound/soc/soc-compress.c @@ -166,6 +166,7 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream) snd_soc_dai_compr_shutdown(cpu_dai, cstream, 1); out: dpcm_path_put(&list); + mutex_unlock(&fe->card->pcm_mutex); be_err: fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO; mutex_unlock(&fe->card->mutex); -- 2.41.0.162.gfafddb0af9-goog