]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: gserial: check if console kthread exists
authorBogdan Mirea <Bogdan-Stefan_mirea@mentor.com>
Sun, 30 Apr 2017 10:21:26 +0000 (13:21 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 16 May 2017 11:11:04 +0000 (14:11 +0300)
commitb4394b614dfe25623dcd8f781ae6284150dcb7a8
tree1aba56ae033ac8b08f305c3d9f63c9db110a4bdf
parent5fd0e38e50498b750cff272ba25d31890733202a
usb: gadget: gserial: check if console kthread exists

Check for bad pointer that may result because of kthread_create failure.
This check is needed since the gserial setup callback function
(gs_console_setup()) is only freeing the info->con_buf in case of
kthread_create failure which will result into bad info->console_thread
pointer.
Without checking info->console_thread pointer validity in the
gserial_console_exit() function, before calling kthread_stop(), the
rmmod will generate Kernel Oops.

Signed-off-by: Bogdan Mirea <Bogdan-Stefan_mirea@mentor.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/function/u_serial.c