|
|
@@ -481,7 +481,11 @@ struct sk_buff *__can_get_echo_skb(struct net_device *dev, unsigned int idx, u8
|
|
|
{
|
|
|
struct can_priv *priv = netdev_priv(dev);
|
|
|
|
|
|
- BUG_ON(idx >= priv->echo_skb_max);
|
|
|
+ if (idx >= priv->echo_skb_max) {
|
|
|
+ netdev_err(dev, "%s: BUG! Trying to access can_priv::echo_skb out of bounds (%u/max %u)\n",
|
|
|
+ __func__, idx, priv->echo_skb_max);
|
|
|
+ return NULL;
|
|
|
+ }
|
|
|
|
|
|
if (priv->echo_skb[idx]) {
|
|
|
/* Using "struct canfd_frame::len" for the frame
|