stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.14 01/35] HID: logitech: check the return value of create_singlethread_workqueue
@ 2019-04-24 14:46 Sasha Levin
  2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 02/35] HID: debug: fix race condition with between rdesc_show() and device removal Sasha Levin
                   ` (33 more replies)
  0 siblings, 34 replies; 35+ messages in thread
From: Sasha Levin @ 2019-04-24 14:46 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Kangjie Lu, Jiri Kosina, Sasha Levin, linux-input

From: Kangjie Lu <kjlu@umn.edu>

[ 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 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 614054af904a..b83d4173fc7f 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -1907,6 +1907,13 @@ static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index)
 		kfree(data);
 		return -ENOMEM;
 	}
+	data->wq = create_singlethread_workqueue("hidpp-ff-sendqueue");
+	if (!data->wq) {
+		kfree(data->effect_ids);
+		kfree(data);
+		return -ENOMEM;
+	}
+
 	data->hidpp = hidpp;
 	data->feature_index = feature_index;
 	data->version = version;
@@ -1951,7 +1958,6 @@ static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index)
 	/* ignore boost value at response.fap.params[2] */
 
 	/* init the hardware command queue */
-	data->wq = create_singlethread_workqueue("hidpp-ff-sendqueue");
 	atomic_set(&data->workqueue_size, 0);
 
 	/* initialize with zero autocenter to get wheel in usable state */
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2019-04-24 14:59 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-24 14:46 [PATCH AUTOSEL 4.14 01/35] HID: logitech: check the return value of create_singlethread_workqueue Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 02/35] HID: debug: fix race condition with between rdesc_show() and device removal Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 03/35] rtc: sh: Fix invalid alarm warning for non-enabled alarm Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 04/35] batman-adv: Reduce claim hash refcnt only for removed entry Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 05/35] batman-adv: Reduce tt_local " Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 06/35] batman-adv: Reduce tt_global " Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 07/35] ARM: dts: rockchip: Fix gpu opp node names for rk3288 Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 08/35] igb: Fix WARN_ONCE on runtime suspend Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 09/35] fm10k: Fix a potential NULL pointer dereference Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 10/35] net/mlx5: E-Switch, Fix esw manager vport indication for more vport commands Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 11/35] bonding: show full hw address in sysfs for slave entries Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 12/35] net: stmmac: ratelimit RX error logs Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 13/35] net: stmmac: don't overwrite discard_frame status Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 14/35] net: stmmac: fix dropping of multi-descriptor RX frames Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 15/35] net: stmmac: don't log oversized frames Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 16/35] jffs2: fix use-after-free on symlink traversal Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 17/35] debugfs: " Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 18/35] rtc: da9063: set uie_unsupported when relevant Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 19/35] HID: input: add mapping for Assistant key Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 20/35] vfio/pci: use correct format characters Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 21/35] vfio/type1: Limit DMA mappings per container Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 22/35] scsi: core: add new RDAC LENOVO/DE_Series device Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 23/35] scsi: storvsc: Fix calculation of sub-channel count Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 24/35] net: hns: fix KASAN: use-after-free in hns_nic_net_xmit_hw() Sasha Levin
2019-04-24 14:46 ` [PATCH AUTOSEL 4.14 25/35] net: hns: Use NAPI_POLL_WEIGHT for hns driver Sasha Levin
2019-04-24 14:47 ` [PATCH AUTOSEL 4.14 26/35] net: hns: Fix probabilistic memory overwrite when HNS driver initialized Sasha Levin
2019-04-24 14:47 ` [PATCH AUTOSEL 4.14 27/35] net: hns: fix ICMP6 neighbor solicitation messages discard problem Sasha Levin
2019-04-24 14:47 ` [PATCH AUTOSEL 4.14 28/35] net: hns: Fix WARNING when remove HNS driver with SMMU enabled Sasha Levin
2019-04-24 14:47 ` [PATCH AUTOSEL 4.14 29/35] kmemleak: powerpc: skip scanning holes in the .bss section Sasha Levin
2019-04-24 14:47 ` [PATCH AUTOSEL 4.14 30/35] hugetlbfs: fix memory leak for resv_map Sasha Levin
2019-04-24 14:47 ` [PATCH AUTOSEL 4.14 31/35] sh: fix multiple function definition build errors Sasha Levin
2019-04-24 14:47 ` [PATCH AUTOSEL 4.14 32/35] kernel/sysctl.c: fix out-of-bounds access when setting file-max Sasha Levin
2019-04-24 14:47 ` [PATCH AUTOSEL 4.14 33/35] xsysace: Fix error handling in ace_setup Sasha Levin
2019-04-24 14:47 ` [PATCH AUTOSEL 4.14 34/35] ARM: orion: don't use using 64-bit DMA masks Sasha Levin
2019-04-24 14:47 ` [PATCH AUTOSEL 4.14 35/35] ARM: iop: " Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).