Reverse the logic in the if statement and eliminate the need for a goto to simplify code readability. Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> --- drivers/net/can/dev/dev.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/net/can/dev/dev.c b/drivers/net/can/dev/dev.c index 735d5de3caa0..9014256c486a 100644 --- a/drivers/net/can/dev/dev.c +++ b/drivers/net/can/dev/dev.c @@ -142,14 +142,11 @@ static void can_restart(struct net_device *dev) /* send restart message upstream */ skb = alloc_can_err_skb(dev, &cf); - if (!skb) - goto restart; + if (skb) { + cf->can_id |= CAN_ERR_RESTARTED; + netif_rx(skb); + } - cf->can_id |= CAN_ERR_RESTARTED; - - netif_rx(skb); - -restart: netdev_dbg(dev, "restarted\n"); priv->can_stats.restarts++; -- 2.40.1