public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mukesh Ojha <mojha@codeaurora.org>
To: Kangjie Lu <kjlu@umn.edu>
Cc: pakki001@umn.edu, Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S. Miller" <davem@davemloft.net>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: stmmac: fix a potential NULL pointer dereference
Date: Wed, 27 Mar 2019 19:12:29 +0530	[thread overview]
Message-ID: <7dbb5203-19fa-36f5-487a-9fbb08a34c4d@codeaurora.org> (raw)
In-Reply-To: <20190312073241.27495-1-kjlu@umn.edu>


On 3/12/2019 1:02 PM, Kangjie Lu wrote:
> In case of_device_get_match_data fails, the fix return -ENOMEM

s/-ENOMEM/-EINVAL


Otherwise looks good to me.
Make the above correction.
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>

-Mukesh

> to avoid the NULL pointer dereference.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
> ---
>   drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
> index 3256e5cbad27..344ead5949b1 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
> @@ -485,6 +485,8 @@ static int dwc_eth_dwmac_remove(struct platform_device *pdev)
>   	int err;
>   
>   	data = of_device_get_match_data(&pdev->dev);
> +	if (!data)
> +		return -EINVAL;
>   
>   	err = stmmac_dvr_remove(&pdev->dev);
>   	if (err < 0)

  parent reply	other threads:[~2019-03-27 13:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12  7:32 [PATCH] net: stmmac: fix a potential NULL pointer dereference Kangjie Lu
2019-03-12  8:28 ` Chen-Yu Tsai
2019-03-27 13:42 ` Mukesh Ojha [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-03-23  3:39 Kangjie Lu
2019-03-26  0:15 ` David Miller
     [not found] ` <0f518f7a-ff1f-b8d9-8468-a1f7648ada46@codeaurora.org>
2019-03-26 19:50   ` David Miller

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=7dbb5203-19fa-36f5-487a-9fbb08a34c4d@codeaurora.org \
    --to=mojha@codeaurora.org \
    --cc=alexandre.torgue@st.com \
    --cc=davem@davemloft.net \
    --cc=joabreu@synopsys.com \
    --cc=kjlu@umn.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pakki001@umn.edu \
    --cc=peppe.cavallaro@st.com \
    /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