Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4820660imm; Mon, 11 Jun 2018 20:24:08 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJVN8ZSKjfgz2mY2lx4tiFudVgcO4tUMIpoExXOO/LrWLDj0MwHslB0LF0KpjBHoC0Yzyze X-Received: by 2002:a63:6ec8:: with SMTP id j191-v6mr1646857pgc.232.1528773847959; Mon, 11 Jun 2018 20:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528773847; cv=none; d=google.com; s=arc-20160816; b=aoayKTNPyPVoCl0AUFBK5Kt09CR81PQWro2TYLXKw2fi/+gJYhWWm7SpEEuEhBo2f1 3HKKUo72zkqWYP/T8SFWS9J+7R2n9lqHtFDUd/pvELm1tppMDlZI4xe32e/sixAn0HNw cO5P1oavn2UpTZKHW2Tzfo8Jx6iq/rPHwH3g7m4e2knFYBkaC9XBcKcZsNYPRBxbbUxk 1AcQItyCU1PdErRkQFw+b+68g90oMZn5OfF73o+N6aeZv9whVX3ePkvb+vBiEDmwFLI2 oB4d3cUIqoeoQAPAGuzPlps2pCLi5EcC50lKekqop0bbXkh8bx+GWRZVr+YpiAzWw+yt Ya5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:message-id:date:subject:cc:from :dkim-signature:arc-authentication-results; bh=Wgt99BBDLEadzYsL5zlvdtmQ4Mh8C5eXQQDuvAoOC90=; b=ubb2rtEKojHRPhkcDXl/H+poR+s2QFU+o+vkvahwcr+9djsU0qTScn6Nn5cYrpYuyu UFJuRwqtfKVti5ij9oro453mByaGHiWpOAlr0KNpq9c52dLSBd9s6IbrkVJ0JDF9/hoU pZmFK9EdAm/Fr0FWiAvPmRcKwhy9b1S2oAdIH/YxtsItc+CX7O5Pe/lkEU5rFtjqT4wc 2G+RZeY+fM4bSBIkHXVBCFEkjKCuM0/nU9ej/rzBPQTGvBEYWKypqGZiKHCQFg7+rh6s 0jjGBB2gS4sYZg6YEUeWuMumMBeV+qkjYCBPA9Jy1CnFk1Wd1q501CdFpn534hfqznJK 57Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=tKJPlsth; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a3-v6si50763601pgq.652.2018.06.11.20.23.53; Mon, 11 Jun 2018 20:24:07 -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=fail header.i=@gmail.com header.s=20161025 header.b=tKJPlsth; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754059AbeFLDXX (ORCPT + 99 others); Mon, 11 Jun 2018 23:23:23 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:41259 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752583AbeFLDXW (ORCPT ); Mon, 11 Jun 2018 23:23:22 -0400 Received: by mail-pf0-f195.google.com with SMTP id a11-v6so11318117pff.8 for ; Mon, 11 Jun 2018 20:23:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Wgt99BBDLEadzYsL5zlvdtmQ4Mh8C5eXQQDuvAoOC90=; b=tKJPlsthKsrfvtzdacETpWWUF6j7ckosY5diXTeOqyaZ5457xcKyApXuYlIqVylAX7 QnDdtLEbzlvaWR/yz9CLtFprCJK+Dkg76xXV5UNruJyiJRRVZZfHW+T1J4hHdo6mXHdT w8oHgdqZaK9KCMaWiUg3fX3lMdwpvbkQecLVzp3s7GQPFyZPHWHFIkDfVqXmbUIc9LCO cG1BuAxZE6JOCaMyQnmLH6yqoB/NsGHz7nl6SfKo1ti+bopPUYxaWtEO8J+0e0JFUX4s u8cs1qqlV0mNfh/ZGU01yXeX0UcZ7SKZZovdMciVhwCJb3T+IkuLjx8V3HkusorMtKUT /8Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Wgt99BBDLEadzYsL5zlvdtmQ4Mh8C5eXQQDuvAoOC90=; b=LSZSw3vLP3kvT1u4ZaXD3rCrzpWg/5i7mR0EiX/7eg9Ir7txA2Jq1uqcSm3FIL8Whp C6cMuIQVHX6bUtZdw5bVaxzGX0IGtJMbJU5D+Y7/jsVTnE+cPEqDNGVsFPzuOEDTZMMD fHrPvD1SlcF/lvNCfrZ7YA24EuoWf2PcF5QUUohrZ8bAOb2xnsAVQ0FM0AoLckCTXudj TBNvncx2ECqvxednJUBitTaoAGqsvAEc6DIS9NJXtsK54+ASbQM5YrsMbnvA4M2AFVFY BLQRgOoIGY3LAIy6yZW28CebugF47vVXVN1viHXxAtwgsJ+6VjEx0L/41SxxsU8IdB3Q akEQ== X-Gm-Message-State: APt69E2X03GA58/vjwYvcTHuAqMsjwqRlOLdPQnHGR/IFVtZYl1F3rVX LVXeel5NHzV3U4EgXVNW8wY= X-Received: by 2002:a65:6690:: with SMTP id b16-v6mr1603904pgw.326.1528773801816; Mon, 11 Jun 2018 20:23:21 -0700 (PDT) Received: from localhost ([103.88.46.82]) by smtp.gmail.com with ESMTPSA id j11-v6sm108823013pff.64.2018.06.11.20.23.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jun 2018 20:23:21 -0700 (PDT) From: Zhouyang Jia Cc: Zhouyang Jia , Jaroslav Kysela , Takashi Iwai , Bhumika Goyal , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH] ALSA: lx6464es: add error handling for pci_ioremap_bar Date: Tue, 12 Jun 2018 11:23:14 +0800 Message-Id: <1528773796-37922-1-git-send-email-jiazhouyang09@gmail.com> X-Mailer: git-send-email 2.7.4 To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When pci_ioremap_bar fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling pci_ioremap_bar. Signed-off-by: Zhouyang Jia --- sound/pci/lx6464es/lx6464es.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/pci/lx6464es/lx6464es.c b/sound/pci/lx6464es/lx6464es.c index 9655b08..6157b6d 100644 --- a/sound/pci/lx6464es/lx6464es.c +++ b/sound/pci/lx6464es/lx6464es.c @@ -1016,6 +1016,10 @@ static int snd_lx6464es_create(struct snd_card *card, /* dsp port */ chip->port_dsp_bar = pci_ioremap_bar(pci, 2); + if (!chip->port_dsp_bar) { + dev_err(card->dev, "cannot remap PCI memory region\n"); + goto request_irq_failed; + } err = request_threaded_irq(pci->irq, lx_interrupt, lx_threaded_irq, IRQF_SHARED, KBUILD_MODNAME, chip); -- 2.7.4