Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3032849pxb; Mon, 18 Apr 2022 14:01:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKlVUQGKPISoxq6mD8DzIP/NS2tbWrKrBOIB1aPGD53CIqsgwf0z38mbu/mDhg0TsRrSrS X-Received: by 2002:a17:906:6144:b0:6cf:bb2e:a2e1 with SMTP id p4-20020a170906614400b006cfbb2ea2e1mr10639710ejl.299.1650315708910; Mon, 18 Apr 2022 14:01:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650315708; cv=none; d=google.com; s=arc-20160816; b=ewUpW5ZkRrc9FYvexE7KbkDnGs9t4uQD1bpgbBW/Um1m8ONsfUoTaPmkvGl3qvkoA6 6NS51n/gwf8Rh7o1C6lxGzNS3IXP0KlVSe84vwPITR6+di9L5EyeHm0IIMmv9dk4kIsO auI4aQ4Mj+SLonnHdm0T+xGWPAZcOIy4VscwH1hP4Ry2PL5I7tiPKt7XhCDS9wM4A2RF 9OsIuPPKjNS6XaPWFAn4zLF18x8Qdk2G0L/FBgs5hzO+OW3e2UPAtaLb3Qm2zHo1jnrn vVljzA4IFK5uLF7MAkaXc+ZqPeNz1cmL0SLLBRDQ4mmz3B+xWzDdpAmufydD4zH1TNps Z2jA== 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=Q8r9oR9Xiut5Nk2VOJSvFMM3VSpbhVAW0Wzgdvm+52I=; b=j3YryuYTNeqllayReRHg2K3mmfQ3Sg/uHwhsFN27lK2+VjOTdnADnlUxf4efKmtU24 +ScR1xHEXCzYIRvnPeAoMPezvIZLRkUugxrfL6Y+kpKbSqxVSR8d+GkBObXjDplDlLzy 5j0mSaM3XT+FqSGkM7RqTCQ6BL8aAJjZTLnOdR8pAaeX4NORkJ6U8mp5EhW1ziPUr3CO J/CkrCt7gCRaw4bMYsHd+hv3NxpaQU0CFqFMuuD4Nor+7D1UzIAsozFqj/4heVn4KXg0 3cFC3OvLz0wBV6yV/LPBeWfS05nbpLc1bNe4ijl0d8YZUL8NQghqNLX73JWUCkuCc31G fr9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C13KDllq; 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 gj2-20020a170907740200b006e7ec2aba88si6397150ejc.948.2022.04.18.14.01.24; Mon, 18 Apr 2022 14:01:48 -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=C13KDllq; 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 S238885AbiDRMbk (ORCPT + 99 others); Mon, 18 Apr 2022 08:31:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239283AbiDRM2P (ORCPT ); Mon, 18 Apr 2022 08:28:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D80701EEDC; Mon, 18 Apr 2022 05:21:34 -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 3159260F0C; Mon, 18 Apr 2022 12:21:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38C7DC385A1; Mon, 18 Apr 2022 12:21:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650284493; bh=p7NdsMGXXKY2Y4BdmKFIYeZ2BS38rKxgfbm27drUnCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C13KDllqz9UFfVKIeYzjIgzs6DI/9qRO4Eagu+HMzBy3I6DW8vcfZvPz38+Xm3ja7 0fEq+VB3vQ5DCFNMVASiIxS4lWycqOXn1qnPLtHaG17bLLe4DzJ266d0+6Z4/kVyS/ Y6aXHrExXJ/XCctszav3xoAP8rC/kE39zrDaPMx8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai , Sasha Levin Subject: [PATCH 5.17 109/219] ALSA: mtpav: Dont call card private_free at probe error path Date: Mon, 18 Apr 2022 14:11:18 +0200 Message-Id: <20220418121209.950400644@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 [ Upstream commit 4fb27190879b82e48ce89a56e9d6c04437dbc065 ] The card destructor of nm256 driver does merely stopping the running timer, 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: aa92050f10f0 ("ALSA: mtpav: Allocate resources with device-managed APIs") Link: https://lore.kernel.org/r/20220412102636.16000-39-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/drivers/mtpav.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c index 11235baaf6fa..f212f233ea61 100644 --- a/sound/drivers/mtpav.c +++ b/sound/drivers/mtpav.c @@ -693,8 +693,6 @@ static int snd_mtpav_probe(struct platform_device *dev) mtp_card->outmidihwport = 0xffffffff; timer_setup(&mtp_card->timer, snd_mtpav_output_timer, 0); - card->private_free = snd_mtpav_free; - err = snd_mtpav_get_RAWMIDI(mtp_card); if (err < 0) return err; @@ -716,6 +714,8 @@ static int snd_mtpav_probe(struct platform_device *dev) if (err < 0) return err; + card->private_free = snd_mtpav_free; + platform_set_drvdata(dev, card); printk(KERN_INFO "Motu MidiTimePiece on parallel port irq: %d ioport: 0x%lx\n", irq, port); return 0; -- 2.35.1