All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: dan.carpenter@oracle.com
Cc: f.fainelli@gmail.com, andrew@lunn.ch, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] mdio_bus: NULL dereference on allocation error
Date: Tue, 12 Jan 2016 14:31:12 -0500 (EST)	[thread overview]
Message-ID: <20160112.143112.1804837472013389455.davem@davemloft.net> (raw)
In-Reply-To: <20160112093435.GD29804@mwanda>

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Tue, 12 Jan 2016 12:34:36 +0300

> If bus = kzalloc() fails then we end up dereferencing bus when we do
> "bus->irq[i] = PHY_POLL;".  The code is a little simpler if we reverse
> the NULL check and return directly on failure.
> 
> Fixes: e7f4dc3536a4 ('mdio: Move allocation of interrupts into core')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied.

WARNING: multiple messages have this Message-ID (diff)
From: David Miller <davem@davemloft.net>
To: dan.carpenter@oracle.com
Cc: f.fainelli@gmail.com, andrew@lunn.ch, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] mdio_bus: NULL dereference on allocation error
Date: Tue, 12 Jan 2016 19:31:12 +0000	[thread overview]
Message-ID: <20160112.143112.1804837472013389455.davem@davemloft.net> (raw)
In-Reply-To: <20160112093435.GD29804@mwanda>

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Tue, 12 Jan 2016 12:34:36 +0300

> If bus = kzalloc() fails then we end up dereferencing bus when we do
> "bus->irq[i] = PHY_POLL;".  The code is a little simpler if we reverse
> the NULL check and return directly on failure.
> 
> Fixes: e7f4dc3536a4 ('mdio: Move allocation of interrupts into core')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied.

  parent reply	other threads:[~2016-01-12 19:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-12  9:34 [patch] mdio_bus: NULL dereference on allocation error Dan Carpenter
2016-01-12  9:34 ` Dan Carpenter
2016-01-12 14:06 ` Andrew Lunn
2016-01-12 14:06   ` Andrew Lunn
2016-01-12 19:31 ` David Miller [this message]
2016-01-12 19:31   ` 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=20160112.143112.1804837472013389455.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=andrew@lunn.ch \
    --cc=dan.carpenter@oracle.com \
    --cc=f.fainelli@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.