Re: [PATCH] staging: octeon-ethernet: trivial: Avoid OOPS if phydev is not set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
> 
> ---
> 
> 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 :)

Care to try again?

Also, how was phydev NULL?  What was causing that?

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel





[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux