bnxt_en: Check devlink allocation and registration status
authorLeon Romanovsky <leonro@nvidia.com>
Thu, 23 Sep 2021 18:12:48 +0000 (21:12 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:25 +0000 (19:16 +0100)
commitaf484a1cde06f46b575a49743fda89faf4f33f64
treee1a742b67199bec9f5e461ca9986bad5951e764f
parente4ecf64c0d10d57cf9b3a52247234d7dd7a3fa9b
bnxt_en: Check devlink allocation and registration status

[ Upstream commit e624c70e1131e145bd0510b8a700b5e2d112e377 ]

devlink is a software interface that doesn't depend on any hardware
capabilities. The failure in SW means memory issues, wrong parameters,
programmer error e.t.c.

Like any other such interface in the kernel, the returned status of
devlink APIs should be checked and propagated further and not ignored.

Fixes: 4ab0c6a8ffd7 ("bnxt_en: add support to enable VF-representors")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h