|
|
@@ -609,8 +609,8 @@ static int kvaser_usb_wait_msg(const struct kvaser_usb *dev, u8 id,
|
|
|
}
|
|
|
|
|
|
if (pos + tmp->len > actual_len) {
|
|
|
- dev_err(dev->udev->dev.parent,
|
|
|
- "Format error\n");
|
|
|
+ dev_err_ratelimited(dev->udev->dev.parent,
|
|
|
+ "Format error\n");
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
@@ -813,6 +813,7 @@ static int kvaser_usb_simple_msg_async(struct kvaser_usb_net_priv *priv,
|
|
|
if (err) {
|
|
|
netdev_err(netdev, "Error transmitting URB\n");
|
|
|
usb_unanchor_urb(urb);
|
|
|
+ kfree(buf);
|
|
|
usb_free_urb(urb);
|
|
|
return err;
|
|
|
}
|
|
|
@@ -1333,7 +1334,7 @@ static void kvaser_usb_read_bulk_callback(struct urb *urb)
|
|
|
goto resubmit_urb;
|
|
|
}
|
|
|
|
|
|
- while (pos <= urb->actual_length - MSG_HEADER_LEN) {
|
|
|
+ while (pos <= (int)(urb->actual_length - MSG_HEADER_LEN)) {
|
|
|
msg = urb->transfer_buffer + pos;
|
|
|
|
|
|
/* The Kvaser firmware can only read and write messages that
|
|
|
@@ -1352,7 +1353,8 @@ static void kvaser_usb_read_bulk_callback(struct urb *urb)
|
|
|
}
|
|
|
|
|
|
if (pos + msg->len > urb->actual_length) {
|
|
|
- dev_err(dev->udev->dev.parent, "Format error\n");
|
|
|
+ dev_err_ratelimited(dev->udev->dev.parent,
|
|
|
+ "Format error\n");
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
@@ -1768,6 +1770,7 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb,
|
|
|
spin_unlock_irqrestore(&priv->tx_contexts_lock, flags);
|
|
|
|
|
|
usb_unanchor_urb(urb);
|
|
|
+ kfree(buf);
|
|
|
|
|
|
stats->tx_dropped++;
|
|
|
|