net: hns: set correct return value
authorPan Bian <bianpan2016@163.com>
Mon, 30 Oct 2017 08:50:01 +0000 (16:50 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 Nov 2017 03:17:44 +0000 (12:17 +0900)
commitd2083d0e92117598dd24ba270af12376f1fb8866
tree9c4ad398f11b477dbf1d222a965201d3f23f0c11
parent7db8874abd9a134821881bb99301b3afbbe9b080
net: hns: set correct return value

The function of_parse_phandle() returns a NULL pointer if it cannot
resolve a phandle property to a device_node pointer. In function
hns_nic_dev_probe(), its return value is passed to PTR_ERR to extract
the error code. However, in this case, the extracted error code will
always be zero, which is unexpected.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Reviewed-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns/hns_enet.c