linux/drivers/net/can/usb
Pavel Skripkin a0b96b4a62 drivers: net: fix memory leak in peak_usb_create_dev
syzbot reported memory leak in peak_usb.
The problem was in case of failure after calling
->dev_init()[2] in peak_usb_create_dev()[1]. The data
allocated int dev_init() wasn't freed, so simple
->dev_free() call fix this problem.

backtrace:
    [<0000000079d6542a>] kmalloc include/linux/slab.h:552 [inline]
    [<0000000079d6542a>] kzalloc include/linux/slab.h:682 [inline]
    [<0000000079d6542a>] pcan_usb_fd_init+0x156/0x210 drivers/net/can/usb/peak_usb/pcan_usb_fd.c:868   [2]
    [<00000000c09f9057>] peak_usb_create_dev drivers/net/can/usb/peak_usb/pcan_usb_core.c:851 [inline] [1]
    [<00000000c09f9057>] peak_usb_probe+0x389/0x490 drivers/net/can/usb/peak_usb/pcan_usb_core.c:949

Reported-by: syzbot+91adee8d9ebb9193d22d@syzkaller.appspotmail.com
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-01 15:55:15 -07:00
..
kvaser_usb can: kvaser_usb: Add support for USBcan Pro 4xHS 2021-03-16 08:41:26 +01:00
peak_usb drivers: net: fix memory leak in peak_usb_create_dev 2021-04-01 15:55:15 -07:00
ems_usb.c can: dev: can_get_echo_skb(): extend to return can frame length 2021-01-14 08:43:43 +01:00
esd_usb2.c can: dev: can_get_echo_skb(): extend to return can frame length 2021-01-14 08:43:43 +01:00
gs_usb.c can: dev: can_get_echo_skb(): extend to return can frame length 2021-01-14 08:43:43 +01:00
Kconfig can: kvaser_usb: Add support for USBcan Pro 4xHS 2021-03-16 08:41:26 +01:00
Makefile can: kvaser_usb: Split driver into kvaser_usb_core.c and kvaser_usb_leaf.c 2018-07-27 10:40:19 +02:00
mcba_usb.c can: mcba_usb: remove h from printk format specifier 2021-01-27 10:01:46 +01:00
ucan.c can: dev: can_get_echo_skb(): extend to return can frame length 2021-01-14 08:43:43 +01:00
usb_8dev.c can: dev: can_get_echo_skb(): extend to return can frame length 2021-01-14 08:43:43 +01:00