From: Dan Carpenter <dan.carpenter@oracle.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: support@caviumnetworks.com, netdev@vger.kernel.org,
driverdev-devel@linuxdriverproject.org,
"Sebastian Pöhn" <sebastian.poehn@gmail.com>
Subject: Re: [PATCH] staging: octeon-ethernet: trivial: Avoid OOPS if phydev is not set
Date: Mon, 14 Oct 2013 13:10:51 +0300 [thread overview]
Message-ID: <20131014101051.GH6192@mwanda> (raw)
In-Reply-To: <20131013212810.GA15167@kroah.com>
On Sun, Oct 13, 2013 at 02:28:10PM -0700, Greg KH wrote:
> On Sun, Oct 13, 2013 at 08:59:54PM +0200, Sebastian Pöhn wrote:
> > A zero pointer deref on priv->phydev->link was causing oops on our systems.
> > Might be related to improper configuration but we should fail gracefully here ;-)
> >
> > Signed-off-by: Sebastian Poehn <sebastian.poehn@googlemail.com>
> >
> > ---
> >
> > diff --git a/drivers/staging/octeon/ethernet-mdio.c b/drivers/staging/octeon/ethernet-mdio.c
> > index 83b1030..bc8c503 100644
> > --- a/drivers/staging/octeon/ethernet-mdio.c
> > +++ b/drivers/staging/octeon/ethernet-mdio.c
> > @@ -121,6 +121,9 @@ static void cvm_oct_adjust_link(struct net_device *dev)
> > struct octeon_ethernet *priv = netdev_priv(dev);
> > cvmx_helper_link_info_t link_info;
> >
> > + if(!priv->phydev)
> > + return ;
>
> Please always run your patches through the scripts/checkpatch.pl tool so
> that maintainers don't have to point out the obvious coding syle errors
> by hand each time :)
Also it's whitespace damaged and doesn't apply.
>
> Care to try again?
>
> Also, how was phydev NULL? What was causing that?
To me it looks like phydev is always NULL.
regards,
dan carpenter
next prev parent reply other threads:[~2013-10-14 10:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-13 18:59 [PATCH] staging: octeon-ethernet: trivial: Avoid OOPS if phydev is not set Sebastian Pöhn
2013-10-13 21:28 ` Greg KH
2013-10-14 10:10 ` Dan Carpenter [this message]
2013-10-14 18:39 ` Aaro Koskinen
2013-10-14 19:16 ` Dan Carpenter
2013-10-14 19:49 ` Aaro Koskinen
2013-10-15 9:47 ` Dan Carpenter
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=20131014101051.GH6192@mwanda \
--to=dan.carpenter@oracle.com \
--cc=driverdev-devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=netdev@vger.kernel.org \
--cc=sebastian.poehn@gmail.com \
--cc=support@caviumnetworks.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 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.