TencentOS-kernel/drivers/net/can
Pavel Skripkin 16ac0853f2 drivers: net: fix memory leak in peak_usb_create_dev
commit a0b96b4a62745397aee662670cfc2157bac03f55 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-20 16:07:04 +08:00
..
c_can can: c_can: move runtime PM enable/disable to c_can_platform 2021-04-12 12:53:28 +08:00
cc770 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
dev net: introduce CAN specific pointer in the struct net_device 2021-05-20 16:06:48 +08:00
ifi_canfd Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
m_can can: tcan4x5x: fix max register value 2021-05-20 16:06:48 +08:00
mscan Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
peak_canfd can: peak_canfd: pucan_handle_can_rx(): fix echo management when loopback is on 2021-03-16 16:40:39 +08:00
rcar Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sja1000 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
softing can: softing: softing_netdev_open(): fix error handling 2021-03-16 16:42:25 +08:00
spi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
usb drivers: net: fix memory leak in peak_usb_create_dev 2021-05-20 16:07:04 +08:00
Kconfig can: kvaser_pciefd: select CONFIG_CRC32 2021-04-12 12:51:18 +08:00
Makefile can: dev: move driver related infrastructure into separate subdir 2021-05-20 16:06:48 +08:00
at91_can.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
flexcan.c can: flexcan: flexcan_chip_freeze(): fix chip freeze for missing bitrate 2021-04-12 12:53:28 +08:00
grcan.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
janz-ican3.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
kvaser_pciefd.c can: kvaser_pciefd: Always disable bus load reporting 2021-04-12 12:53:28 +08:00
led.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pch_can.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
slcan.c net: introduce CAN specific pointer in the struct net_device 2021-05-20 16:06:48 +08:00
sun4i_can.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ti_hecc.c can: ti_hecc: Fix memleak in ti_hecc_probe 2021-03-16 16:41:18 +08:00
vcan.c net: introduce CAN specific pointer in the struct net_device 2021-05-20 16:06:48 +08:00
vxcan.c net: introduce CAN specific pointer in the struct net_device 2021-05-20 16:06:48 +08:00
xilinx_can.c can: xilinx_can: handle failure cases of pm_runtime_get_sync 2021-03-16 16:40:38 +08:00