From patchwork Tue Oct 24 16:56:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaroslav Kysela X-Patchwork-Id: 10025103 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 64C3560375 for ; Tue, 24 Oct 2017 16:57:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5224628A1C for ; Tue, 24 Oct 2017 16:57:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4456528A4A; Tue, 24 Oct 2017 16:57:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2847328A1C for ; Tue, 24 Oct 2017 16:57:06 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 76004267373; Tue, 24 Oct 2017 18:57:04 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 59125267374; Tue, 24 Oct 2017 18:57:02 +0200 (CEST) Received: from mail1.perex.cz (mail1.perex.cz [77.48.224.245]) by alsa0.perex.cz (Postfix) with ESMTP id 84E0F266DB1 for ; Tue, 24 Oct 2017 18:57:00 +0200 (CEST) Received: from mail1.perex.cz (localhost [127.0.0.1]) by smtp1.perex.cz (Perex's E-mail Delivery System) with ESMTP id CE8A8A0040; Tue, 24 Oct 2017 18:56:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.perex.cz CE8A8A0040 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perex.cz; s=default; t=1508864219; bh=/qPbHPglfG2ILBMAJ4QCjjq9BcP60NVeAXH0IuMW4oY=; h=From:To:Cc:Subject:Date:From; b=CKgELgaGFXYS1Fkc8Yp8IyzZJ5VY6fR5ttD0f9HbCdopUYYFl86r5S/gN6HrjvlWv NHPGRnaZBLqxiE5iAqpICCMGJ7qMKrZdGrZC53iUf/GrJNjgGzYASw24+0SFWzqBpR KnjGTfddTHc8MzssddaxS/PeJR+vCjQuVxZroOP4= Received: from p50.perex-int.cz.com (unknown [109.235.177.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: perex) by mail1.perex.cz (Perex's E-mail Delivery System) with ESMTPSA; Tue, 24 Oct 2017 18:56:56 +0200 (CEST) From: Jaroslav Kysela To: ALSA development Date: Tue, 24 Oct 2017 18:56:47 +0200 Message-Id: <20171024165647.8417-1-perex@perex.cz> X-Mailer: git-send-email 2.13.6 Cc: Takashi Iwai Subject: [alsa-devel] [PATCH] ALSA: hda controller - handle -1 value as error in snd_hdac_bus_parse_capabilities() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP We have seen this value on a development platform. Signed-off-by: Jaroslav Kysela --- sound/hda/hdac_controller.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c index 978dc1801b3a..4a1823290b2d 100644 --- a/sound/hda/hdac_controller.c +++ b/sound/hda/hdac_controller.c @@ -278,6 +278,11 @@ int snd_hdac_bus_parse_capabilities(struct hdac_bus *bus) do { cur_cap = _snd_hdac_chip_readl(bus, offset); + if (cur_cap == 0xffffffff) { + dev_dbg(bus->dev, "Wrong capability -1\n"); + break; + } + dev_dbg(bus->dev, "Capability version: 0x%x\n", (cur_cap & AZX_CAP_HDR_VER_MASK) >> AZX_CAP_HDR_VER_OFF);