Commit c4409e9f authored by Marc Kleine-Budde's avatar Marc Kleine-Budde

can: ti_hecc: ti_hecc_error(): increase error counters if skb enqueueing via...

can: ti_hecc: ti_hecc_error(): increase error counters if skb enqueueing via can_rx_offload_queue_sorted() fails

The call to can_rx_offload_queue_sorted() may fail and return an error
(in the current implementation due to resource shortage). The passed skb
is consumed.

This patch adds incrementing of the appropriate error counters to let
the device statistics reflect that there's a problem.
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 75812433
...@@ -558,6 +558,7 @@ static int ti_hecc_error(struct net_device *ndev, int int_status, ...@@ -558,6 +558,7 @@ static int ti_hecc_error(struct net_device *ndev, int int_status,
struct can_frame *cf; struct can_frame *cf;
struct sk_buff *skb; struct sk_buff *skb;
u32 timestamp; u32 timestamp;
int err;
/* propagate the error condition to the can stack */ /* propagate the error condition to the can stack */
skb = alloc_can_err_skb(ndev, &cf); skb = alloc_can_err_skb(ndev, &cf);
...@@ -639,7 +640,9 @@ static int ti_hecc_error(struct net_device *ndev, int int_status, ...@@ -639,7 +640,9 @@ static int ti_hecc_error(struct net_device *ndev, int int_status,
} }
timestamp = hecc_read(priv, HECC_CANLNT); timestamp = hecc_read(priv, HECC_CANLNT);
can_rx_offload_queue_sorted(&priv->offload, skb, timestamp); err = can_rx_offload_queue_sorted(&priv->offload, skb, timestamp);
if (err)
ndev->stats.rx_fifo_errors++;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment