Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4804028pxb; Mon, 15 Feb 2021 01:26:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5WWnmfWuesRBh/rberDzuZq5IuvENdqliEm3FWjg0yabYEzfIJnbMeenq4HREy6kn0+mx X-Received: by 2002:a17:906:4013:: with SMTP id v19mr15011138ejj.5.1613381165676; Mon, 15 Feb 2021 01:26:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613381165; cv=none; d=google.com; s=arc-20160816; b=J7f4HuPLUq5Az+PhCCDIyH80ByY3tHaBOGHxYmgLyya4pAqXqD0L8GNh5eOjA1w9qb VEg1vBaocpDdrG4hoHw4otPPz9WXVNHFK+P9DqCWxGEsLh3g/feQLcFzakVRo9T8BHO8 XSYwdJTyjQZNcuVx5sBYs+WJwfsb5sK8m+qSX2RkG+CpsUqnKYkKZCw0b5xQFGkERMTk xcKOPzh9Q+/fVF8dfiyte5nrUy8sPxDVI0VJb3vYOOllly1rZZBUitXjQYrI3ZWu8xvY VEq442oC0XJoo7nLA9vXCfxY6TbgEmNM6mMtjX01JR3ieZZ8dFs2WavozU/PjdEezgR6 T8bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=I8DhorN/R/0NEhIhojvB+rUWph3c8ggz1VFs23Q0d7s=; b=wti4s8PkxcsoRXas+LiG/VWtxJn9D6BJHt7Cvm+mtJJsDGSvNKSKURI8GuQfgdvj8+ hr9KKWHpKg79KH+QnI6aamaQMxKasuqNr2dhHdDZuNtO25U30O/nwm0LxlJ3Mw6iTeFf 0e4ZuyqnoqpyqRh1DEUlqlGHOkqNVLhxAiE7G4rHl/HcBfCGbwf2gCY/Al60h5fGCp4d cSwtar2gtr7ctZ5dpB9LexWuTIZSZ0LGRmBuyYpRiJ9UBpBcUPTU7L9wIUq9lzCu3TuC SQg0lDAYJcA9AXet+wIXZ4D3dXUSIDUxGJ/p+/5rl8gQkgVI59rIdEgtCl2QfT0Y1shw ixqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b8si12776073edz.576.2021.02.15.01.25.42; Mon, 15 Feb 2021 01:26:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230048AbhBOJYz (ORCPT + 99 others); Mon, 15 Feb 2021 04:24:55 -0500 Received: from lizzard.sbs.de ([194.138.37.39]:55851 "EHLO lizzard.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbhBOJYy (ORCPT ); Mon, 15 Feb 2021 04:24:54 -0500 Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id 11F9Nuvm020273 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 15 Feb 2021 10:23:56 +0100 Received: from [139.22.41.241] ([139.22.41.241]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 11F9NtlX003811; Mon, 15 Feb 2021 10:23:55 +0100 Subject: Re: [PATCH] spi: pca2xx-pci: Fix an issue about missing call to 'pci_free_irq_vectors()' To: Dejin Zheng , daniel@zonque.org, haojian.zhuang@gmail.com, robert.jarzmik@free.fr, broonie@kernel.org, andriy.shevchenko@linux.intel.com, jarkko.nikula@linux.intel.com, linux-spi@vger.kernel.org Cc: linux-kernel@vger.kernel.org References: <20210214145746.602770-1-zhengdejin5@gmail.com> From: Jan Kiszka Message-ID: Date: Mon, 15 Feb 2021 10:23:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210214145746.602770-1-zhengdejin5@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14.02.21 15:57, Dejin Zheng wrote: > Call to 'pci_free_irq_vectors()' are missing both in the error handling > path of the probe function, and in the remove function. So add them. > > Fixes: 64e02cb0bdfc7c ("spi: pca2xx-pci: Allow MSI") > Signed-off-by: Dejin Zheng > --- > drivers/spi/spi-pxa2xx-pci.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c > index 14fc41ed2361..1ec840e78ff4 100644 > --- a/drivers/spi/spi-pxa2xx-pci.c > +++ b/drivers/spi/spi-pxa2xx-pci.c > @@ -254,8 +254,10 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev, > snprintf(buf, sizeof(buf), "pxa2xx-spi.%d", ssp->port_id); > ssp->clk = clk_register_fixed_rate(&dev->dev, buf , NULL, 0, > c->max_clk_rate); > - if (IS_ERR(ssp->clk)) > - return PTR_ERR(ssp->clk); > + if (IS_ERR(ssp->clk)) { > + ret = PTR_ERR(ssp->clk); > + goto err_irq; > + } > > memset(&pi, 0, sizeof(pi)); > pi.fwnode = dev->dev.fwnode; > @@ -268,12 +270,16 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev, > pdev = platform_device_register_full(&pi); > if (IS_ERR(pdev)) { > clk_unregister(ssp->clk); > - return PTR_ERR(pdev); > + ret = PTR_ERR(pdev); > + goto err_irq; > } > > pci_set_drvdata(dev, pdev); > > return 0; > +err_irq: > + pci_free_irq_vectors(dev); > + return ret; > } > > static void pxa2xx_spi_pci_remove(struct pci_dev *dev) > @@ -283,6 +289,7 @@ static void pxa2xx_spi_pci_remove(struct pci_dev *dev) > > spi_pdata = dev_get_platdata(&pdev->dev); > > + pci_free_irq_vectors(dev); > platform_device_unregister(pdev); > clk_unregister(spi_pdata->ssp.clk); > } > Reviewed-by: Jan Kiszka Thanks! Jan -- Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux