net: hns3: Check variable is valid before assigning it to another
authorYonglong Liu <liuyonglong@huawei.com>
Wed, 20 Feb 2019 02:32:41 +0000 (10:32 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Feb 2019 00:29:04 +0000 (16:29 -0800)
commit676131f7c53ecdd79e29fc8cfcdefe6f9f2485e8
tree6d1a3e46c8a0f39359e55cfbc1a6d2ec345cfa10
parentbdd59d661153a59af79112676565276ae2a1f457
net: hns3: Check variable is valid before assigning it to another

In hnae3_register_ae_dev(), ae_algo->ops is assigned to ae_dev->ops
before check that ae_algo->ops is valid.

And in hnae3_register_ae_algo(), missing check for ae_algo->ops.

This patch fixes them.

Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hnae3.c