From: Greg Kroah-Hartman Date: Mon, 14 Apr 2025 13:55:51 +0000 (+0200) Subject: fix up hid patch X-Git-Tag: v6.12.24~104 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f32f9d3e69e7fd6a49704388adae8015d4d4ebab;p=thirdparty%2Fkernel%2Fstable-queue.git fix up hid patch --- diff --git a/queue-5.10/hid-pidff-fix-null-pointer-dereference-in-pidff_find.patch b/queue-5.10/hid-pidff-fix-null-pointer-dereference-in-pidff_find.patch index c05559b162..850cd926bc 100644 --- a/queue-5.10/hid-pidff-fix-null-pointer-dereference-in-pidff_find.patch +++ b/queue-5.10/hid-pidff-fix-null-pointer-dereference-in-pidff_find.patch @@ -31,38 +31,34 @@ Tested-by: Cristóferson Bueno Tested-by: Pablo Cisneros Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman --- - drivers/hid/usbhid/hid-pidff.c | 10 ++++++++++ + drivers/hid/usbhid/hid-pidff.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c -index ba0d7cb15377e..7801294fe086d 100644 --- a/drivers/hid/usbhid/hid-pidff.c +++ b/drivers/hid/usbhid/hid-pidff.c -@@ -770,6 +770,11 @@ static void pidff_set_autocenter(struct input_dev *dev, u16 magnitude) - static int pidff_find_fields(struct pidff_usage *usage, const u8 *table, - struct hid_report *report, int count, int strict) +@@ -772,6 +772,11 @@ static int pidff_find_fields(struct pidf { + int i, j, k, found; + + if (!report) { + pr_debug("pidff_find_fields, null report\n"); + return -1; + } + - int i, j, k, found; - for (k = 0; k < count; k++) { -@@ -883,6 +888,11 @@ static int pidff_reports_ok(struct pidff_device *pidff) - static struct hid_field *pidff_find_special_field(struct hid_report *report, - int usage, int enforce_min) + found = 0; + for (i = 0; i < report->maxfield; i++) { +@@ -885,6 +890,11 @@ static struct hid_field *pidff_find_spec { + int i; + + if (!report) { + pr_debug("pidff_find_special_field, null report\n"); + return NULL; + } + - int i; - for (i = 0; i < report->maxfield; i++) { --- -2.39.5 - + if (report->field[i]->logical == (HID_UP_PID | usage) && + report->field[i]->report_count > 0) { diff --git a/queue-5.15/hid-pidff-fix-null-pointer-dereference-in-pidff_find.patch b/queue-5.15/hid-pidff-fix-null-pointer-dereference-in-pidff_find.patch index ffa17e6335..59375847a1 100644 --- a/queue-5.15/hid-pidff-fix-null-pointer-dereference-in-pidff_find.patch +++ b/queue-5.15/hid-pidff-fix-null-pointer-dereference-in-pidff_find.patch @@ -31,38 +31,34 @@ Tested-by: Cristóferson Bueno Tested-by: Pablo Cisneros Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman --- - drivers/hid/usbhid/hid-pidff.c | 10 ++++++++++ + drivers/hid/usbhid/hid-pidff.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c -index a01c1b2ab2f4c..26cb331b646ca 100644 --- a/drivers/hid/usbhid/hid-pidff.c +++ b/drivers/hid/usbhid/hid-pidff.c -@@ -770,6 +770,11 @@ static void pidff_set_autocenter(struct input_dev *dev, u16 magnitude) - static int pidff_find_fields(struct pidff_usage *usage, const u8 *table, - struct hid_report *report, int count, int strict) +@@ -772,6 +772,11 @@ static int pidff_find_fields(struct pidf { + int i, j, k, found; + + if (!report) { + pr_debug("pidff_find_fields, null report\n"); + return -1; + } + - int i, j, k, found; - for (k = 0; k < count; k++) { -@@ -883,6 +888,11 @@ static int pidff_reports_ok(struct pidff_device *pidff) - static struct hid_field *pidff_find_special_field(struct hid_report *report, - int usage, int enforce_min) + found = 0; + for (i = 0; i < report->maxfield; i++) { +@@ -885,6 +890,11 @@ static struct hid_field *pidff_find_spec { + int i; + + if (!report) { + pr_debug("pidff_find_special_field, null report\n"); + return NULL; + } + - int i; - for (i = 0; i < report->maxfield; i++) { --- -2.39.5 - + if (report->field[i]->logical == (HID_UP_PID | usage) && + report->field[i]->report_count > 0) { diff --git a/queue-5.4/hid-pidff-fix-null-pointer-dereference-in-pidff_find.patch b/queue-5.4/hid-pidff-fix-null-pointer-dereference-in-pidff_find.patch index 7419de65dc..6a8c39789a 100644 --- a/queue-5.4/hid-pidff-fix-null-pointer-dereference-in-pidff_find.patch +++ b/queue-5.4/hid-pidff-fix-null-pointer-dereference-in-pidff_find.patch @@ -31,38 +31,34 @@ Tested-by: Cristóferson Bueno Tested-by: Pablo Cisneros Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman --- - drivers/hid/usbhid/hid-pidff.c | 10 ++++++++++ + drivers/hid/usbhid/hid-pidff.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c -index ba0d7cb15377e..7801294fe086d 100644 --- a/drivers/hid/usbhid/hid-pidff.c +++ b/drivers/hid/usbhid/hid-pidff.c -@@ -770,6 +770,11 @@ static void pidff_set_autocenter(struct input_dev *dev, u16 magnitude) - static int pidff_find_fields(struct pidff_usage *usage, const u8 *table, - struct hid_report *report, int count, int strict) +@@ -772,6 +772,11 @@ static int pidff_find_fields(struct pidf { + int i, j, k, found; + + if (!report) { + pr_debug("pidff_find_fields, null report\n"); + return -1; + } + - int i, j, k, found; - for (k = 0; k < count; k++) { -@@ -883,6 +888,11 @@ static int pidff_reports_ok(struct pidff_device *pidff) - static struct hid_field *pidff_find_special_field(struct hid_report *report, - int usage, int enforce_min) + found = 0; + for (i = 0; i < report->maxfield; i++) { +@@ -885,6 +890,11 @@ static struct hid_field *pidff_find_spec { + int i; + + if (!report) { + pr_debug("pidff_find_special_field, null report\n"); + return NULL; + } + - int i; - for (i = 0; i < report->maxfield; i++) { --- -2.39.5 - + if (report->field[i]->logical == (HID_UP_PID | usage) && + report->field[i]->report_count > 0) {