[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191119215844.GB4495@amd>
Date: Tue, 19 Nov 2019 22:58:44 +0100
From: Pavel Machek <pavel@...x.de>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
"Gustavo A. R. Silva" <gustavo@...eddedor.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Honghui Zhang <honghui.zhang@...iatek.com>,
Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 4.19 242/422] PCI: mediatek: Fix unchecked return value
Hi!
On Tue 2019-11-19 06:17:19, Greg Kroah-Hartman wrote:
>
> [ Upstream commit 17a0a1e5f6c4bd6df17834312ff577c1373d87b8 ]
>
> Check return value of devm_pci_remap_iospace().
>
> index c5ff6ca65eab2..0d100f56cb884 100644
> --- a/drivers/pci/controller/pcie-mediatek.c
> +++ b/drivers/pci/controller/pcie-mediatek.c
> @@ -1120,7 +1120,9 @@ static int mtk_pcie_request_resources(struct mtk_pcie *pcie)
> if (err < 0)
> return err;
>
> - devm_pci_remap_iospace(dev, &pcie->pio, pcie->io.start);
> + err = devm_pci_remap_iospace(dev, &pcie->pio, pcie->io.start);
> + if (err)
> + return err;
>
> return 0;
> }
You can just do return devm_pci_remap_iospace(dev, &pcie->pio,
pcie->io.start); instead. No need for if ()...
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists