提交 df9000ef 编写于 作者: P Pavel Belous 提交者: 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: NPavel Belous <pavel.belous@aquantia.com>
Reviewed-by: NLino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b350d7b8
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册