Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3529702pxb; Tue, 19 Apr 2022 04:50:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcF6xVzqeXM3G8yB1lp7CPTIPPjZtTZeQ/bsMYXyefWpNiRG0pZ378KfBQzdiHGQ3kNM86 X-Received: by 2002:a17:903:240c:b0:153:c8df:7207 with SMTP id e12-20020a170903240c00b00153c8df7207mr15227842plo.44.1650369033068; Tue, 19 Apr 2022 04:50:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650369033; cv=none; d=google.com; s=arc-20160816; b=jyHXZ4m64fooOCvLBwfjCMb46x3R3XvrSIymIIA9KyKIMnpaKPw0ZvYuueQrhOIvXJ gWvXcDU4X8I9twkorePIWmm3Q5wIbzkkXO9Kdg8cBklTJCES0hNJgYxujU4wzLXHSdB2 lBxz3GU6JZsZh4RmWogiEVPnwsNUJyW+A1e2bFD9ymps16J93jSPtdpF1KQK9g7//I8E q5UPqNq8KQcoN0G61saN7QPasKGsEGFitVYaTXf9V91co6OQtDNrODDQ8Nc9kKjeL3iE KtMiEpKuER39fZbP9DvmBdhaZ79II0DFHAqxaBF1eXPVsU4klxWqJM5Jzvsdx1yVtKsx eRQA== 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=oDdNoB414SjwKNASXAum9WtBw4g4q1pmGAlhQgaxeYE=; b=vn9aI8xLXPOhZM8a0vvuo7H2uK5q2puYnPmWbITnuiqjVAat+HAkgXp2ZIpy3gW0DH V6myf+oueolTlYTJwljJE97FzetcCDxM12Pf1s5qKy43YKM8iQ9kh9yNygjbg5p1Y5bz M8vEgNEAE0VlJnlnha3dZ2f/Tf/4ZsjRhXl6Q2laZlk9zAFl6qCBSQjzt6edQMCYnFCZ LQJ0D6RT8PPGwvkiwQQQGDnakCKoZ3wJUpvCEKnQZSulXe4Hf2ZixIvQtNSwtrH+1DGb H11iXNJqJdsRgTLl7HBX5OeGx1DOSJaeIFYzUreJAymSIBVr5t7cjxbR/fWWyQd3xa02 MTEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kuYjkCSe; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i12-20020a65484c000000b0039d80004fcasi11251879pgs.221.2022.04.19.04.50.18; Tue, 19 Apr 2022 04:50:33 -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=@linuxfoundation.org header.s=korg header.b=kuYjkCSe; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238400AbiDRMXV (ORCPT + 99 others); Mon, 18 Apr 2022 08:23:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238443AbiDRMWU (ORCPT ); Mon, 18 Apr 2022 08:22:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CDD31DA43; Mon, 18 Apr 2022 05:17:43 -0700 (PDT) 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 2536360F09; Mon, 18 Apr 2022 12:17:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24B8FC385A7; Mon, 18 Apr 2022 12:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650284262; bh=8Gc79g/ewNAkBhYPJOhBtDDF+BWfLbtJud2ozjhSDOk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kuYjkCSeU5GwQ0/281OR2lBXX0ssl8BzRMK65gbw8nom2XqZuWZg2Fc7TxX3vNrie agOVPMvGUIWfsr3Xa9wpHwoA9XrpmWIqTGh4P95RCu92SnfkuAmBId5f1xgpRcrXic 5okvWAZMQLsf+pJ86yh+UAnWJ4JoKlLuwbsCLzQI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai Subject: [PATCH 5.17 057/219] ALSA: nm256: Dont call card private_free at probe error path Date: Mon, 18 Apr 2022 14:10:26 +0200 Message-Id: <20220418121206.925490145@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121203.462784814@linuxfoundation.org> References: <20220418121203.462784814@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=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Takashi Iwai commit f20ae5074dfb38f23b0c07c62bdf8e7254a0acf8 upstream. The card destructor of nm256 driver does merely stopping the running streams, and it's superfluous for the probe error handling. Moreover, calling this via the previous devres change would lead to another problem due to the reverse call order. This patch moves the setup of the private_free callback after the card registration, so that it can be used only after fully set up. Fixes: c19935f04784 ("ALSA: nm256: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-40-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/nm256/nm256.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/sound/pci/nm256/nm256.c +++ b/sound/pci/nm256/nm256.c @@ -1573,7 +1573,6 @@ snd_nm256_create(struct snd_card *card, chip->coeffs_current = 0; snd_nm256_init_chip(chip); - card->private_free = snd_nm256_free; // pci_set_master(pci); /* needed? */ return 0; @@ -1680,6 +1679,7 @@ static int snd_nm256_probe(struct pci_de err = snd_card_register(card); if (err < 0) return err; + card->private_free = snd_nm256_free; pci_set_drvdata(pci, card); return 0;