linux-kernel-mentees.lists.linuxfoundation.org archive mirror
 help / color / mirror / Atom feed
* [Linux-kernel-mentees] [PATCH] HID: hid-lg4ff: Fix uninit-value set_autocenter_default
@ 2019-11-05 14:18 Phong Tran
  2019-11-18  9:43 ` Benjamin Tissoires
  0 siblings, 1 reply; 4+ messages in thread
From: Phong Tran @ 2019-11-05 14:18 UTC (permalink / raw)
  To: benjamin.tissoires
  Cc: syzbot+1234691fec1b8ceba8b1, linux-kernel-mentees, linux-kernel,
	linux-input

syzbot found a problem using of uinit pointer in
lg4ff_set_autocenter_default().

Reported-by: syzbot+1234691fec1b8ceba8b1@syzkaller.appspotmail.com

Tested by syzbot:

https://groups.google.com/d/msg/syzkaller-bugs/ApnMLW6sfKE/Qq0bIHGEAQAJ

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
---
 drivers/hid/hid-lg4ff.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c
index 5e6a0cef2a06..44dfd08b0c32 100644
--- a/drivers/hid/hid-lg4ff.c
+++ b/drivers/hid/hid-lg4ff.c
@@ -468,10 +468,10 @@ static int lg4ff_play(struct input_dev *dev, void *data, struct ff_effect *effec
 static void lg4ff_set_autocenter_default(struct input_dev *dev, u16 magnitude)
 {
 	struct hid_device *hid = input_get_drvdata(dev);
-	s32 *value;
+	s32 *value = NULL;
 	u32 expand_a, expand_b;
-	struct lg4ff_device_entry *entry;
-	struct lg_drv_data *drv_data;
+	struct lg4ff_device_entry *entry = NULL;
+	struct lg_drv_data *drv_data = NULL;
 	unsigned long flags;
 
 	drv_data = hid_get_drvdata(hid);
-- 
2.20.1

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

end of thread, other threads:[~2019-11-25 15:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-05 14:18 [Linux-kernel-mentees] [PATCH] HID: hid-lg4ff: Fix uninit-value set_autocenter_default Phong Tran
2019-11-18  9:43 ` Benjamin Tissoires
2019-11-19 13:29   ` Phong Tran
2019-11-25 15:14     ` Benjamin Tissoires

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).