[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3b66425c-975d-a829-2dff-d48ee6862ab2@gmx.de>
Date: Wed, 15 Feb 2017 22:04:16 +0100
From: Lino Sanfilippo <LinoSanfilippo@....de>
To: Pavel Belous <Pavel.Belous@...antia.com>,
"David S . Miller" <davem@...emloft.net>
Cc: netdev@...r.kernel.org,
Simon Edelhaus <Simon.Edelhaus@...antia.com>,
Alexey Andriyanov <Alexey.Andriyanov@...antia.com>
Subject: Re: [PATCH net-next 08/13] net: ethernet: aquantia: Null pointer
check for aq_nic_ndev_alloc.
On 15.02.2017 21:01, Pavel Belous wrote:
> From: Pavel Belous <pavel.belous@...antia.com>
>
> We should check for a null pointer for aq_nic_ndev_alloc
> instead netdev_priv.
>
> Signed-off-by: Pavel Belous <pavel.belous@...antia.com>
> ---
> drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
> index 4cf633c..e50fba2 100644
> --- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
> +++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
> @@ -202,12 +202,13 @@ struct aq_nic_s *aq_nic_alloc_cold(const struct net_device_ops *ndev_ops,
> int err = 0;
>
> ndev = aq_nic_ndev_alloc();
> - self = netdev_priv(ndev);
> - if (!self) {
> - err = -EINVAL;
> + if (!ndev) {
> + err = -ENOMEM;
> goto err_exit;
> }
>
> + self = netdev_priv(ndev);
> +
> ndev->netdev_ops = ndev_ops;
> ndev->ethtool_ops = et_ops;
>
>
Reviewed-by: Lino Sanfilippo <LinoSanfilippo@....de>
Regards,
Lino
Powered by blists - more mailing lists