OSDN Git Service

HID: logitech: check the return value of create_singlethread_workqueue
authorKangjie Lu <kjlu@umn.edu>
Thu, 14 Mar 2019 05:24:02 +0000 (00:24 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 May 2019 05:19:08 +0000 (07:19 +0200)
commit72bbf78c4dfcfdb9b7e3efed7e5abe426697e171
tree947fac9cf14d0979fe9cfb2234d19031888f2241
parent87b622f949e4cfe8bc6aa0db724aeef71784f7a6
HID: logitech: check the return value of create_singlethread_workqueue

[ Upstream commit 6c44b15e1c9076d925d5236ddadf1318b0a25ce2 ]

create_singlethread_workqueue may fail and return NULL. The fix checks if it is
NULL to avoid NULL pointer dereference.  Also, the fix moves the call of
create_singlethread_workqueue earlier to avoid resource-release issues.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/hid-logitech-hidpp.c