From: "Hennerich, Michael" <Michael.Hennerich@analog.com>
To: Kangjie Lu <kjlu@umn.edu>
Cc: "pakki001@umn.edu" <pakki001@umn.edu>,
Alexander Aring <alex.aring@gmail.com>,
Stefan Schmidt <stefan@datenfreihafen.org>,
"David S. Miller" <davem@davemloft.net>,
"linux-wpan@vger.kernel.org" <linux-wpan@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] net: ieee802154: fix a potential NULL pointer dereference
Date: Mon, 11 Mar 2019 07:30:31 +0000 [thread overview]
Message-ID: <BN3PR0301MB0897817BBE72CE6A33A1DE728E480@BN3PR0301MB0897.namprd03.prod.outlook.com> (raw)
In-Reply-To: <20190311072517.29740-1-kjlu@umn.edu>
> -----Original Message-----
> From: Kangjie Lu [mailto:kjlu@umn.edu]
> Sent: Montag, 11. März 2019 08:25
> To: kjlu@umn.edu
> Cc: pakki001@umn.edu; Hennerich, Michael <Michael.Hennerich@analog.com>; Alexander Aring <alex.aring@gmail.com>; Stefan
> Schmidt <stefan@datenfreihafen.org>; David S. Miller <davem@davemloft.net>; linux-wpan@vger.kernel.org;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] net: ieee802154: fix a potential NULL pointer dereference
>
> In case alloc_ordered_workqueue fails, the fix releases
> sources and returns -ENOMEM to avoid NULL pointer dereference.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
> ---
> drivers/net/ieee802154/adf7242.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> 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;
> + }
>
> ret = adf7242_hw_init(lp);
> if (ret)
> --
> 2.17.1
next prev parent reply other threads:[~2019-03-11 7:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-11 7:25 [PATCH] net: ieee802154: fix a potential NULL pointer dereference Kangjie Lu
2019-03-11 7:30 ` Hennerich, Michael [this message]
2019-03-13 9:08 ` Stefan Schmidt
2019-03-13 9:09 ` Stefan Schmidt
2019-03-13 9:09 ` Stefan Schmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BN3PR0301MB0897817BBE72CE6A33A1DE728E480@BN3PR0301MB0897.namprd03.prod.outlook.com \
--to=michael.hennerich@analog.com \
--cc=alex.aring@gmail.com \
--cc=davem@davemloft.net \
--cc=kjlu@umn.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wpan@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pakki001@umn.edu \
--cc=stefan@datenfreihafen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).