Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2025209imu; Fri, 14 Dec 2018 04:42:08 -0800 (PST) X-Google-Smtp-Source: AFSGD/U3m9aQFqZIH7cxhAk+6qnA4SH6Sbdt3Ci36/9gcoqEF17RXtXtbpA0sOfj9HiQrL6gnNp9 X-Received: by 2002:a62:7892:: with SMTP id t140mr2666649pfc.237.1544791328078; Fri, 14 Dec 2018 04:42:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544791328; cv=none; d=google.com; s=arc-20160816; b=qzMAHms2s4W0UPMg8mYXER4+6reSwmqop8giynmYlHd8eWkPdW/Kgi66BTtFnhQQkK NIgB9LJKttMUDLJ9ALOcSnTAviWBTznBcYtemEOFwGYQidPMfo7OgdQktuH2dwucM96R zYhAWF/4j+Vp6Lo7U2V6/+U0fO/2PRjXmBSNh0ji+SVMNwJvulaeBqLiAYXRDMklzdUe 9YvIJzJo2BmfDCQE+PPqFbfQB4E6Iyo0fueDlLvdtC9OfgcejS0ncliiIkAgiBzXnIh6 9isQ4C5196FOJQHC01Ou0zQJYzPVthyMS/ljf6MGa3VQJWfrdwC7JvBumuyU8V9gILg8 aDTg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VAlxSCZywyuw38Y6iPWiuhKn100Hz3DlIcqtBKLSFL0=; b=oIbHeEs9gEZcQnrGReKkNZtIJvX8sjK2/0neS5SvnkPAbtB1jg5L8T+m7iy/tpnnIA 6SSHJp7Y0ybE+Y119pYqQEutC0wGEmpn1fSMyRfCRAecNP+lVaa3rSCrVVF+BE4zy04j 0Be+vIiMEvP0jt3RbeRSotKMuQs3PR22RWZbGln++pbWqOhkewThYMC75WeJxtKyrzpP 1BxLtQui/2OdHKERkXF9QxMG4D2ZxRkT+JgRfygZmUJQM0XihMFv+dqmpBmuQI4aQIny XkMVv8Hd8AUq51li8wTEBUfxNoigPfTAyObKX66tPWBK1RUA6Y0Cu3uKLvb5im1kqKGO TX5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=w3aVwJpU; 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 d18si4041995pgm.212.2018.12.14.04.41.53; Fri, 14 Dec 2018 04:42:08 -0800 (PST) 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=w3aVwJpU; 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 S1730370AbeLNMDr (ORCPT + 99 others); Fri, 14 Dec 2018 07:03:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:47856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729821AbeLNMDp (ORCPT ); Fri, 14 Dec 2018 07:03:45 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1A50B2146E; Fri, 14 Dec 2018 12:03:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544789024; bh=rmTb5UOv47vg4kth5Zv6gCy5saXcBqdhnMZlaBAIuNA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w3aVwJpUUAbjFNEuxl/6/a6ktyY/akKOczmki/kBNLGyfn3n2sJwU8fmkgGDT4HxJ mW2rXgg4x07dVDNkL77aEBtmqmJs+KoJ0wnQpKEQAb2LHjmIPcqD3r0cZziVdXMFnz 6uOFcuvQeoGsMxvVaZ6DBRnak+yZybTHNzZsIxoo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Keyon Jie , Pierre-Louis Bossart , Mark Brown , Sasha Levin Subject: [PATCH 4.19 064/142] ASoC: acpi: fix: continue searching when machine is ignored Date: Fri, 14 Dec 2018 12:59:09 +0100 Message-Id: <20181214115749.617884539@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181214115747.053633987@linuxfoundation.org> References: <20181214115747.053633987@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit a3e620f8422832afd832ad5e20aa97d0c72bada8 ] The machine_quirk may return NULL which means the acpi entries should be skipped and search for next matched entry is needed, here add return check here and continue for NULL case. Signed-off-by: Keyon Jie Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-acpi.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-acpi.c b/sound/soc/soc-acpi.c index b8e72b52db30..4fb29f0e561e 100644 --- a/sound/soc/soc-acpi.c +++ b/sound/soc/soc-acpi.c @@ -10,11 +10,17 @@ struct snd_soc_acpi_mach * snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines) { struct snd_soc_acpi_mach *mach; + struct snd_soc_acpi_mach *mach_alt; for (mach = machines; mach->id[0]; mach++) { if (acpi_dev_present(mach->id, NULL, -1)) { - if (mach->machine_quirk) - mach = mach->machine_quirk(mach); + if (mach->machine_quirk) { + mach_alt = mach->machine_quirk(mach); + if (!mach_alt) + continue; /* not full match, ignore */ + mach = mach_alt; + } + return mach; } } -- 2.19.1