net: hns3: fix dereference of ae_dev before it is null checked
authorColin Ian King <colin.king@canonical.com>
Mon, 17 Jun 2019 11:42:14 +0000 (12:42 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Jun 2019 21:02:57 +0000 (14:02 -0700)
commitad9bf5451945877c73ca3f49b803648363322f0e
treee62efe0eca002b1519a5db02166d940f315bf8e9
parent43321251e2f2805aac8fa70bb084814388a91002
net: hns3: fix dereference of ae_dev before it is null checked

Pointer ae_dev is null checked however, prior to that it is dereferenced
when assigned pointer ops. Fix this by assigning pointer ops after ae_dev
has been null checked.

Addresses-Coverity: ("Dereference before null check")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c