Skip to content

Commit bc6c03f

Browse files
Wei Yongjundavem330
authored andcommitted
nfp: fix error return code in nfp_net_netdev_open()
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 73725d9 ("nfp: allocate ring SW structs dynamically") Signed-off-by: Wei Yongjun <[email protected]> Acked-by: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d6f64d7 commit bc6c03f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/net/ethernet/netronome/nfp/nfp_net_common.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,12 +2044,16 @@ static int nfp_net_netdev_open(struct net_device *netdev)
20442044

20452045
nn->rx_rings = kcalloc(nn->num_rx_rings, sizeof(*nn->rx_rings),
20462046
GFP_KERNEL);
2047-
if (!nn->rx_rings)
2047+
if (!nn->rx_rings) {
2048+
err = -ENOMEM;
20482049
goto err_free_lsc;
2050+
}
20492051
nn->tx_rings = kcalloc(nn->num_tx_rings, sizeof(*nn->tx_rings),
20502052
GFP_KERNEL);
2051-
if (!nn->tx_rings)
2053+
if (!nn->tx_rings) {
2054+
err = -ENOMEM;
20522055
goto err_free_rx_rings;
2056+
}
20532057

20542058
for (r = 0; r < nn->num_r_vecs; r++) {
20552059
err = nfp_net_prepare_vector(nn, &nn->r_vecs[r], r);

0 commit comments

Comments
 (0)