]> git.baikalelectronics.ru Git - kernel.git/commit
net: chelsio: cxgb4vf: Fix an error code in cxgb4vf_pci_probe()
authorZheyu Ma <zheyuma97@gmail.com>
Tue, 23 Nov 2021 02:21:50 +0000 (02:21 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 23 Nov 2021 12:15:53 +0000 (12:15 +0000)
commitd69d3e00b3c8217e2913bfb983bafd85b04a73b5
tree52893a72ed379f0292a87240a8363e559ebccd1f
parentec69e4c3b45770357e3060ac0c8eae4da6bc2558
net: chelsio: cxgb4vf: Fix an error code in cxgb4vf_pci_probe()

During the process of driver probing, probe function should return < 0
for failure, otherwise kernel will treat value == 0 as success.

Therefore, we should set err to -EINVAL when
adapter->registered_device_map is NULL. Otherwise kernel will assume
that driver has been successfully probed and will cause unexpected
errors.

Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c