Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2487180ybb; Sun, 5 Apr 2020 08:43:27 -0700 (PDT) X-Google-Smtp-Source: APiQypKLynosKVmgYKgJa7K7atO5VBbXqvpxJ4ILgkMauS7jvD5E3mg8S2jGsbXC5lM/TVTZDERI X-Received: by 2002:a9d:ecc:: with SMTP id 70mr13620525otj.193.1586101406847; Sun, 05 Apr 2020 08:43:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586101406; cv=none; d=google.com; s=arc-20160816; b=Opuw0BiPzkGM8vhX2ZoqjqEwD2tlBZ9iHFg8NMiLW2bgNLdDoPyC6TRiB56OeFY1UJ Tj94CM0qir+XXU+VU4zuLJ7UsqsBN6K9KqDDVxnWXSSYBbgcXGLlLgxOb+/oVs//rofP Z44vY5Z2Xrwq3ofgRr4nBu2ZOkwOaErtRY0uNzOO0V8rHJvWvKOJC/OUVm8tfw5oxa7k b9pppIz5iebNUHHg/BNp0oWOCmkAcHwmM9IWWUWJ24k2dsQtZAsXPOaKS5aYJxEV+Q9R fJgVukk4PgXYsR08js/Eepd7l+mQskukzFdqvHb1t7As4VSruA+cLC38GkKpWCHiEwGt N2Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=wnrpF+m1MSbYdqGOK5Gmp5Qjd4Qa9Ik4UGcrrzObSNQ=; b=vi3oiy/VmQd/6FmNdMywsrR1TFsQr2HnoIA3oGToIsAngMlaVYYIi6l16ihrn7/SWN x8APmou5JzDc6YPcu8y4Rezpd7wY/bhs/pK1D2mGsfzsBDAlzd1Hm3cKS36PXMC+0W67 o6Oo+Q3aHmGhhDvxNtHQqfj6brG7wo/gAH9wqwqmtJ9ao3Tg4Vpd4tz9FxGUz5JqoIto Xnso199j3i+S3KxblWSX39NRMDkYwexNsMecgYhalj+AJ9PdoHAfAbEVhpkbNdlhdFef xkghys1meefxXkG8t6KDspYcAR2t6Hmt5hs26XPMW/DJD4sPH76PxGzOCm9yHNcy3v5x POdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n70si6517239ota.89.2020.04.05.08.43.14; Sun, 05 Apr 2020 08:43:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727026AbgDEPmd (ORCPT + 99 others); Sun, 5 Apr 2020 11:42:33 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:12420 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726717AbgDEPmd (ORCPT ); Sun, 5 Apr 2020 11:42:33 -0400 X-IronPort-AV: E=Sophos;i="5.72,348,1580770800"; d="scan'208";a="443899687" Received: from palace.rsr.lip6.fr (HELO palace.lip6.fr) ([132.227.105.202]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES256-SHA256; 05 Apr 2020 17:42:31 +0200 From: Julia Lawall To: Olivier Moysan Cc: kernel-janitors@vger.kernel.org, Arnaud Pouliquen , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Maxime Coquelin , Alexandre Torgue , alsa-devel@alsa-project.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: stm32: sai: Add missing cleanup Date: Sun, 5 Apr 2020 17:03:48 +0200 Message-Id: <1586099028-5104-1-git-send-email-Julia.Lawall@inria.fr> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The commit 0d6defc7e0e4 ("ASoC: stm32: sai: manage rebind issue") converts some function calls to their non-devm equivalents. The appropriate cleanup code was added to the remove function, but not to the probe function. Add a call to snd_dmaengine_pcm_unregister to compensate for the call to snd_dmaengine_pcm_register in case of subsequent failure. Fixes: commit 0d6defc7e0e4 ("ASoC: stm32: sai: manage rebind issue") Signed-off-by: Julia Lawall --- Not tested. sound/soc/stm/stm32_sai_sub.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c index 2bd280c..0d0c9af 100644 --- a/sound/soc/stm/stm32_sai_sub.c +++ b/sound/soc/stm/stm32_sai_sub.c @@ -1556,8 +1556,10 @@ static int stm32_sai_sub_probe(struct platform_device *pdev) ret = snd_soc_register_component(&pdev->dev, &stm32_component, &sai->cpu_dai_drv, 1); - if (ret) + if (ret) { + snd_dmaengine_pcm_unregister(&pdev->dev); return ret; + } if (STM_SAI_PROTOCOL_IS_SPDIF(sai)) conf = &stm32_sai_pcm_config_spdif;