Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp249558ybd; Tue, 25 Jun 2019 20:43:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqzjqRTY15f9S4eReM5D8/eQ5O7i0if7Ma7fD1ctJ5U71hjesGv+7D11biz/BZygRSk1adTh X-Received: by 2002:a17:902:3225:: with SMTP id y34mr2488438plb.135.1561520621547; Tue, 25 Jun 2019 20:43:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561520621; cv=none; d=google.com; s=arc-20160816; b=AvVq6ISe1ix4EXh8QnQ5sgeeiBnmbDW82PO1WwOF3bB+TcpEk5xFYglWTIKX/Syseh Wa9KISf171z2xffAev8qz4H4sIeT5Ew4XCRuBL3tp2mYB89HLF+UCRl5nXFMjYxIwnBT mzEQ8AWC7VrTMQrsMc1uXbi0nKsgZmMgZmJ09D5PEip53enYXxEgMui9cmKuteLpq9/W 1eeFefdhpXo1A3zMiApwvJ8O1ZyFZ7bOrlF+EE+/cu3jbXTO7ghFgCV+A69tl8WgsGXR yNfXlSWmtzga/k3I2wkJG/02SnrEurkUtwfM5gza0y0HW+2b3TLZFwmOCKlHlIp64mcD YDMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6XQdg+7cHdvbpk5R94LTQNg0gD9B+kiB28J4LGjCKWs=; b=J9CyZb3x+s9xSgFZKVfm/gKj9GBy87PsNdTWKLTYI4mtQF9vEq5sIjUvaYEzgT6Lhw Jo/PRXotRgXQGFFQwmiQ8DNCE+3WYpjyWs9ajhm/bZNZmMioEQ3bc21tnfOR0hHryBvj EcZll9rXTlDpqPktlj9GHuK+G5gnj/fFYYIeyzUQ9eatR+NsVPjdLCJg69SMnUTN+byQ Tjgb8BaVxjTuCP/X4At9IDmAQq8Iq4KTK7a3flCcREl3SjjriGn2HB0lAjRVvOWYPOKo 7a6dHfj+D4774TbBC4rGBcH9DjhEWmInEOl0nrBY+ZuKoUEP0Rs9Rrwy6DKDTzy2lRJm Rfww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JdWTfzJ3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 19si16397351pfi.81.2019.06.25.20.43.25; Tue, 25 Jun 2019 20:43:41 -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; dkim=pass header.i=@kernel.org header.s=default header.b=JdWTfzJ3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727162AbfFZDmp (ORCPT + 99 others); Tue, 25 Jun 2019 23:42:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:53638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727150AbfFZDml (ORCPT ); Tue, 25 Jun 2019 23:42:41 -0400 Received: from sasha-vm.mshome.net (mobile-107-77-172-74.mobile.att.net [107.77.172.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 01C75205ED; Wed, 26 Jun 2019 03:42:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561520561; bh=6W2VSnFN7wHB/iB0PN2SxLJq50Uw4ZGmfXh0na+eioY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JdWTfzJ3OcWyrPDodir+sy/MvsfAImi4oqxaRw38eyMOve1Dsi96NtFl28/U+U32e ZECjBGp7CqUdD0tNMGd1oZ48gieKZSPEKCmC/pd5OQsMlR0ees96OAF9QjY5Pgxr+V yxY8ItO2IwXAKNj0uxG8izfWrq29yc1o9mDdQ9bM= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Pierre-Louis Bossart , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL 5.1 29/51] ASoC: Intel: cht_bsw_nau8824: fix kernel oops with platform_name override Date: Tue, 25 Jun 2019 23:40:45 -0400 Message-Id: <20190626034117.23247-29-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190626034117.23247-1-sashal@kernel.org> References: <20190626034117.23247-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pierre-Louis Bossart [ Upstream commit 096701e8131425044d2054a0c210d6ea24ee7386 ] The platform override code uses devm_ functions to allocate memory for the new name but the card device is not initialized. Fix by moving the init earlier. Fixes: 4506db8043341 ("ASoC: Intel: cht_bsw_nau8824: platform name fixup support") Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/intel/boards/cht_bsw_nau8824.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/cht_bsw_nau8824.c b/sound/soc/intel/boards/cht_bsw_nau8824.c index 02c2fa239331..20fae391c75a 100644 --- a/sound/soc/intel/boards/cht_bsw_nau8824.c +++ b/sound/soc/intel/boards/cht_bsw_nau8824.c @@ -257,6 +257,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev) snd_soc_card_set_drvdata(&snd_soc_card_cht, drv); /* override plaform name, if required */ + snd_soc_card_cht.dev = &pdev->dev; mach = (&pdev->dev)->platform_data; platform_name = mach->mach_params.platform; @@ -266,7 +267,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev) return ret_val; /* register the soc card */ - snd_soc_card_cht.dev = &pdev->dev; ret_val = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cht); if (ret_val) { dev_err(&pdev->dev, -- 2.20.1