Commit df9000ef authored by Pavel Belous's avatar Pavel Belous Committed by David S. Miller

net: ethernet: aquantia: Null pointer check for aq_nic_ndev_alloc.

We should check for a null pointer for aq_nic_ndev_alloc
instead netdev_priv.
Signed-off-by: default avatarPavel Belous <pavel.belous@aquantia.com>
Reviewed-by: default avatarLino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b350d7b8
...@@ -202,12 +202,13 @@ struct aq_nic_s *aq_nic_alloc_cold(const struct net_device_ops *ndev_ops, ...@@ -202,12 +202,13 @@ struct aq_nic_s *aq_nic_alloc_cold(const struct net_device_ops *ndev_ops,
int err = 0; int err = 0;
ndev = aq_nic_ndev_alloc(); ndev = aq_nic_ndev_alloc();
self = netdev_priv(ndev); if (!ndev) {
if (!self) { err = -ENOMEM;
err = -EINVAL;
goto err_exit; goto err_exit;
} }
self = netdev_priv(ndev);
ndev->netdev_ops = ndev_ops; ndev->netdev_ops = ndev_ops;
ndev->ethtool_ops = et_ops; ndev->ethtool_ops = et_ops;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment