Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1743861pxb; Wed, 9 Feb 2022 03:39:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJzodevX7xOVN8QiLnRPLIzc9FYxJtd4CM5ai0PCoYBQcQpFXwLHXZ0WrD7BoTYyswS9RxhI X-Received: by 2002:a17:90a:2e87:: with SMTP id r7mr2052942pjd.61.1644406758737; Wed, 09 Feb 2022 03:39:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644406758; cv=none; d=google.com; s=arc-20160816; b=Obxv+vGVU7fB7FSZk81BbEvgnwYuYPmL0rjURHxs+torj5K4gEIjqRzUSJgPlmFv/3 l7c01ifHTlwBAz8LMvd9Cy3OXY5KkOLWhbDeDmLlOrqziwp3dyDMph1wIewWYHCFFrYF 2Bo4ywBygaPJma3C14ZOuAtguEqR6c+4tYMqkq2OmSxCYiELVu/dl/k4c10flOwhgwAM b3qn6Gcs9masUYXPdYxAEsvtB2YB2RphIhUBMH+S+I+gRhmr/4v3hcDzXNgtUjLgM/bV 8HTYC6LellV9Ujwz+fBMi3DJt7SmbARvXL43chuf0rl04rtLKQjOd0PCPayKDhoqLxNn 5sUA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5aMamlYp9+VTmNX3b2DlHMazM9hN0tN0MOFMps7lgYU=; b=fY+0DhasSe2Xbt1SmYkjf2bwHbBXW6jk54a/vC5IJPQDebZaURkdk9d9C/4gbBHS3i eCkEr2OFS6QxRkC9L6FLSB34GK/hYzTpXqiyAz53POVTkDkAzWkqBxN6vE15Tsa/yrsZ DUWTTlPT0nRzXUsiOOgfDz4hzd8jFETYIieCB8CDXoTNuN0M0xnOooebmPLh7uGNYEPI s/PmMU1Sujc82Z8FafFeuy1Qxk+gLTqIeTUHXTnc+q4RDLhJBkQ58J21Bv/vHICBlnIU 5e8TwXuBx+bE1Xhz7Z/iSHcUQzyXzG0qeV9jSHXkeynztjYmv1ImlS4hQP5UZtog+OXV VTOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Q9B6zcw8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q17si3225284pgv.566.2022.02.09.03.39.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 03:39:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Q9B6zcw8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8136DE03CD85; Wed, 9 Feb 2022 01:55:39 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383365AbiBGLWU (ORCPT + 99 others); Mon, 7 Feb 2022 06:22:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381875AbiBGLRj (ORCPT ); Mon, 7 Feb 2022 06:17:39 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE657C0401F4; Mon, 7 Feb 2022 03:17:26 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6A06C6126D; Mon, 7 Feb 2022 11:17:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3EE50C004E1; Mon, 7 Feb 2022 11:17:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644232645; bh=hqkNVBOY0nLILtHUbF7Ph3I2L0K2QYQl+6SqV0lpEbs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q9B6zcw8TZuoxHCeUYgmNpo3INvOI33TOldrgbd/2zbWxNFTs4wZ0dF8SY60Bpy2G 7fKx6XD4AoyyYjORbnZ4Onoyl8o+jbtl1H39RgO2OuKibWc5fdSTo5U1app7F5YKT6 AvaTRWHdEJxdRPhFvSpmXxHb6ZnN2gO4P+4XKX1E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Mark Brown Subject: [PATCH 4.19 77/86] ASoC: fsl: Add missing error handling in pcm030_fabric_probe Date: Mon, 7 Feb 2022 12:06:40 +0100 Message-Id: <20220207103800.195504006@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220207103757.550973048@linuxfoundation.org> References: <20220207103757.550973048@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Miaoqian Lin commit fb25621da5702c104ce0a48de5b174ced09e5b4e upstream. Add the missing platform_device_put() and platform_device_del() before return from pcm030_fabric_probe in the error handling case. Fixes: c912fa913446 ("ASoC: fsl: register the wm9712-codec") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220127131336.30214-1-linmq006@gmail.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/fsl/pcm030-audio-fabric.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- a/sound/soc/fsl/pcm030-audio-fabric.c +++ b/sound/soc/fsl/pcm030-audio-fabric.c @@ -90,16 +90,21 @@ static int pcm030_fabric_probe(struct pl dev_err(&op->dev, "platform_device_alloc() failed\n"); ret = platform_device_add(pdata->codec_device); - if (ret) + if (ret) { dev_err(&op->dev, "platform_device_add() failed: %d\n", ret); + platform_device_put(pdata->codec_device); + } ret = snd_soc_register_card(card); - if (ret) + if (ret) { dev_err(&op->dev, "snd_soc_register_card() failed: %d\n", ret); + platform_device_del(pdata->codec_device); + platform_device_put(pdata->codec_device); + } platform_set_drvdata(op, pdata); - return ret; + } static int pcm030_fabric_remove(struct platform_device *op)