[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190503083213.GB5834@amd>
Date: Fri, 3 May 2019 10:32:14 +0200
From: Pavel Machek <pavel@...x.de>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Kangjie Lu <kjlu@....edu>,
Michael Hennerich <michael.hennerich@...log.com>,
Stefan Schmidt <stefan@...enfreihafen.org>,
"Sasha Levin (Microsoft)" <sashal@...nel.org>
Subject: Re: [PATCH 4.19 09/72] net: ieee802154: fix a potential NULL pointer
dereference
On Thu 2019-05-02 17:20:31, Greg Kroah-Hartman wrote:
> [ Upstream commit 2795e8c251614ac0784c9d41008551109f665716 ]
>
> In case alloc_ordered_workqueue fails, the fix releases
> sources and returns -ENOMEM to avoid NULL pointer dereference.
>
> Signed-off-by: Kangjie Lu <kjlu@....edu>
> Acked-by: Michael Hennerich <michael.hennerich@...log.com>
> Signed-off-by: Stefan Schmidt <stefan@...enfreihafen.org>
> Signed-off-by: Sasha Levin (Microsoft) <sashal@...nel.org>
> diff --git a/drivers/net/ieee802154/adf7242.c b/drivers/net/ieee802154/adf7242.c
> index cd1d8faccca5..cd6b95e673a5 100644
> --- a/drivers/net/ieee802154/adf7242.c
> +++ b/drivers/net/ieee802154/adf7242.c
> @@ -1268,6 +1268,10 @@ static int adf7242_probe(struct spi_device *spi)
> INIT_DELAYED_WORK(&lp->work, adf7242_rx_cal_work);
> lp->wqueue = alloc_ordered_workqueue(dev_name(&spi->dev),
> WQ_MEM_RECLAIM);
> + if (unlikely(!lp->wqueue)) {
> + ret = -ENOMEM;
> + goto err_hw_init;
> + }
>
This does ieee802154_free_hw(lp->hw) before adf7242_hw_init(). I don't
think that's correct.
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