Re: [PATCH net-next] vmxnet3: prevent div-by-zero panic when ringresizing uninitialized dev

From: David Miller
Date: Wed Mar 06 2013 - 15:38:49 EST


From: Bhavesh Davda <bhavesh@xxxxxxxxxx>
Date: Wed, 6 Mar 2013 09:46:24 -0800

> Linux is free to call ethtool ops as soon as a netdev exists when probe
> finishes. However, we only allocate vmxnet3 tx/rx queues and initialize the
> rx_buf_per_pkt field in struct vmxnet3_adapter when the interface is
> opened (UP).
>
> Signed-off-by: Bhavesh Davda <bhavesh@xxxxxxxxxx>
> Signed-off-by: Shreyas N Bhatewara <sbhatewara@xxxxxxxxxx>
> ---
> drivers/net/vmxnet3/vmxnet3_drv.c | 3 ++-
> drivers/net/vmxnet3/vmxnet3_ethtool.c | 6 ++++++
> drivers/net/vmxnet3/vmxnet3_int.h | 4 ++--
> 3 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
> index 4aad350..bfc5898 100644
> --- a/drivers/net/vmxnet3/vmxnet3_drv.c
> +++ b/drivers/net/vmxnet3/vmxnet3_drv.c
> @@ -2922,7 +2922,7 @@ vmxnet3_probe_device(struct pci_dev *pdev,
> (int)num_online_cpus());
> else
> #endif
> - num_rx_queues = 1;
> + num_rx_queues = 1;

Why are you un-indenting this else branch? Please don't do that.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/