Skip to content

Commit 502a2ce

Browse files
committed
Merge tag 'linux-can-fixes-for-5.16-20220105' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
Marc Kleine-Budde says: ==================== pull-request: can 2022-01-05 It consists of 2 patches, both by me. The first one fixes the use of an uninitialized variable in the gs_usb driver the other one a skb_over_panic in the ISOTP stack in case of reception of too large ISOTP messages. * tag 'linux-can-fixes-for-5.16-20220105' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: isotp: convert struct tpcon::{idx,len} to unsigned int can: gs_usb: fix use of uninitialized variable, detach device on reception of invalid USB data ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 75acfdb + 5f33a09 commit 502a2ce

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

drivers/net/can/usb/gs_usb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ static void gs_usb_receive_bulk_callback(struct urb *urb)
321321

322322
/* device reports out of range channel id */
323323
if (hf->channel >= GS_MAX_INTF)
324-
goto resubmit_urb;
324+
goto device_detach;
325325

326326
dev = usbcan->canch[hf->channel];
327327

@@ -406,6 +406,7 @@ static void gs_usb_receive_bulk_callback(struct urb *urb)
406406

407407
/* USB failure take down all interfaces */
408408
if (rc == -ENODEV) {
409+
device_detach:
409410
for (rc = 0; rc < GS_MAX_INTF; rc++) {
410411
if (usbcan->canch[rc])
411412
netif_device_detach(usbcan->canch[rc]->netdev);

net/can/isotp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ enum {
119119
};
120120

121121
struct tpcon {
122-
int idx;
123-
int len;
122+
unsigned int idx;
123+
unsigned int len;
124124
u32 state;
125125
u8 bs;
126126
u8 sn;

0 commit comments

Comments
 (0)