Tested-by: Pablo Cisneros <patchkez@protonmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- 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) {
Tested-by: Pablo Cisneros <patchkez@protonmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- 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) {
Tested-by: Pablo Cisneros <patchkez@protonmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- 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) {