Skip to content

Commit

Permalink
Merge branch 'fixes-for-3.11' of git://gitorious.org/linux-can/linux-can
Browse files Browse the repository at this point in the history
Marc Kleine-Budde says:

====================
here are two fixes for the v3.11 release cycle:

Maximilian Schneider contributes a patch for the esd_usb2 CAN driver. It adds
sanity checking to the data coming from the USB CAN adapter before using it.
Alexey Khoroshilov from the Linux Driver Verification project fixes an urb leak
in the error handling of the USB 8dev's usb_8dev_start() function.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jul 21, 2013
2 parents 1faabf2 + 7671986 commit 8d716c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/net/can/usb/esd_usb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,20 @@ static void esd_usb2_read_bulk_callback(struct urb *urb)

switch (msg->msg.hdr.cmd) {
case CMD_CAN_RX:
if (msg->msg.rx.net >= dev->net_count) {
dev_err(dev->udev->dev.parent, "format error\n");
break;
}

esd_usb2_rx_can_msg(dev->nets[msg->msg.rx.net], msg);
break;

case CMD_CAN_TX:
if (msg->msg.txdone.net >= dev->net_count) {
dev_err(dev->udev->dev.parent, "format error\n");
break;
}

esd_usb2_tx_done_msg(dev->nets[msg->msg.txdone.net],
msg);
break;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/can/usb/usb_8dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ static int usb_8dev_start(struct usb_8dev_priv *priv)
usb_unanchor_urb(urb);
usb_free_coherent(priv->udev, RX_BUFFER_SIZE, buf,
urb->transfer_dma);
usb_free_urb(urb);
break;
}

Expand Down

0 comments on commit 8d716c7

Please sign in to comment.