public inbox for linux-input@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 0/2] hid: hid-pl.c update
@ 2026-02-16 13:43 Oliver Neukum
  2026-02-16 13:44 ` [PATCHv2 1/2] hid: hid-pl: handle probe errors Oliver Neukum
  2026-02-16 13:44 ` [PATCH 2/2] hid: hid-pl: eliminate private debug macro Oliver Neukum
  0 siblings, 2 replies; 5+ messages in thread
From: Oliver Neukum @ 2026-02-16 13:43 UTC (permalink / raw)
  To: jikos, bentiss, linux-input

This seems to have fallen through the cracks. The first
patch eliminates a failure to properly handle errors
in probe. We have to give up in the error case or
a pointer will remain uninitialized and wil eventually be followed.
Secondly we fix a debug macro by going to dynamic debugging.

V2: resend the full series

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

* [PATCHv2 1/2] hid: hid-pl: handle probe errors
  2026-02-16 13:43 [PATCHv2 0/2] hid: hid-pl.c update Oliver Neukum
@ 2026-02-16 13:44 ` Oliver Neukum
  2026-02-26 15:06   ` Jiri Kosina
  2026-02-16 13:44 ` [PATCH 2/2] hid: hid-pl: eliminate private debug macro Oliver Neukum
  1 sibling, 1 reply; 5+ messages in thread
From: Oliver Neukum @ 2026-02-16 13:44 UTC (permalink / raw)
  To: jikos, bentiss, linux-input; +Cc: Oliver Neukum, stable

Errors in init must be reported back or we'll
follow a NULL pointer the first time FF is used,
because plff_init() initializes the private member.

V2: resend full series

Fixes: 20eb127906709 ("hid: force feedback driver for PantherLord USB/PS2 2in1 Adapter")
Cc: <stable@vger.kernel.org>
Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/hid/hid-pl.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/hid-pl.c b/drivers/hid/hid-pl.c
index 3c8827081dea..dc11d5322fc0 100644
--- a/drivers/hid/hid-pl.c
+++ b/drivers/hid/hid-pl.c
@@ -194,9 +194,14 @@ static int pl_probe(struct hid_device *hdev, const struct hid_device_id *id)
 		goto err;
 	}
 
-	plff_init(hdev);
+	ret = plff_init(hdev);
+	if (ret)
+		goto stop;
 
 	return 0;
+
+stop:
+	hid_hw_stop(hdev);
 err:
 	return ret;
 }
-- 
2.53.0


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

* [PATCH 2/2] hid: hid-pl: eliminate private debug macro
  2026-02-16 13:43 [PATCHv2 0/2] hid: hid-pl.c update Oliver Neukum
  2026-02-16 13:44 ` [PATCHv2 1/2] hid: hid-pl: handle probe errors Oliver Neukum
@ 2026-02-16 13:44 ` Oliver Neukum
  2026-02-26 15:07   ` Jiri Kosina
  1 sibling, 1 reply; 5+ messages in thread
From: Oliver Neukum @ 2026-02-16 13:44 UTC (permalink / raw)
  To: jikos, bentiss, linux-input; +Cc: Oliver Neukum

Use proper dynamic debugging.

V2: resend full series

Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/hid/hid-pl.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/hid/hid-pl.c b/drivers/hid/hid-pl.c
index dc11d5322fc0..4b6b33597d11 100644
--- a/drivers/hid/hid-pl.c
+++ b/drivers/hid/hid-pl.c
@@ -24,10 +24,6 @@
  */
 
 
-/* #define DEBUG */
-
-#define debug(format, arg...) pr_debug("hid-plff: " format "\n" , ## arg)
-
 #include <linux/input.h>
 #include <linux/slab.h>
 #include <linux/module.h>
@@ -53,14 +49,14 @@ static int hid_plff_play(struct input_dev *dev, void *data,
 
 	left = effect->u.rumble.strong_magnitude;
 	right = effect->u.rumble.weak_magnitude;
-	debug("called with 0x%04x 0x%04x", left, right);
+	dev_dbg(&dev->dev, "called with 0x%04x 0x%04x", left, right);
 
 	left = left * plff->maxval / 0xffff;
 	right = right * plff->maxval / 0xffff;
 
 	*plff->strong = left;
 	*plff->weak = right;
-	debug("running with 0x%02x 0x%02x", left, right);
+	dev_dbg(&dev->dev,"running with 0x%02x 0x%02x", left, right);
 	hid_hw_request(hid, plff->report, HID_REQ_SET_REPORT);
 
 	return 0;
@@ -119,7 +115,7 @@ static int plff_init(struct hid_device *hid)
 			report->field[0]->value[1] = 0x00;
 			strong = &report->field[0]->value[2];
 			weak = &report->field[0]->value[3];
-			debug("detected single-field device");
+			dev_dbg(&hid->dev, "detected single-field device");
 		} else if (report->field[0]->maxusage == 1 &&
 			   report->field[0]->usage[0].hid ==
 				(HID_UP_LED | 0x43) &&
@@ -134,7 +130,7 @@ static int plff_init(struct hid_device *hid)
 			weak = &report->field[3]->value[0];
 			if (hid->vendor == USB_VENDOR_ID_JESS2)
 				maxval = 0xff;
-			debug("detected 4-field device");
+			dev_dbg(&hid->dev, "detected 4-field device");
 		} else {
 			hid_err(hid, "not enough fields or values\n");
 			return -ENODEV;
-- 
2.53.0


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

* Re: [PATCHv2 1/2] hid: hid-pl: handle probe errors
  2026-02-16 13:44 ` [PATCHv2 1/2] hid: hid-pl: handle probe errors Oliver Neukum
@ 2026-02-26 15:06   ` Jiri Kosina
  0 siblings, 0 replies; 5+ messages in thread
From: Jiri Kosina @ 2026-02-26 15:06 UTC (permalink / raw)
  To: Oliver Neukum; +Cc: bentiss, linux-input, stable

On Mon, 16 Feb 2026, Oliver Neukum wrote:

> Errors in init must be reported back or we'll
> follow a NULL pointer the first time FF is used,
> because plff_init() initializes the private member.
> 
> V2: resend full series

This one is in Linus' tree as 3756a272d2cf3 already.

-- 
Jiri Kosina
SUSE Labs


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

* Re: [PATCH 2/2] hid: hid-pl: eliminate private debug macro
  2026-02-16 13:44 ` [PATCH 2/2] hid: hid-pl: eliminate private debug macro Oliver Neukum
@ 2026-02-26 15:07   ` Jiri Kosina
  0 siblings, 0 replies; 5+ messages in thread
From: Jiri Kosina @ 2026-02-26 15:07 UTC (permalink / raw)
  To: Oliver Neukum; +Cc: bentiss, linux-input

On Mon, 16 Feb 2026, Oliver Neukum wrote:

> Use proper dynamic debugging.
> 
> V2: resend full series
> 
> Signed-off-by: Oliver Neukum <oneukum@suse.com>
> ---
>  drivers/hid/hid-pl.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/hid/hid-pl.c b/drivers/hid/hid-pl.c
> index dc11d5322fc0..4b6b33597d11 100644
> --- a/drivers/hid/hid-pl.c
> +++ b/drivers/hid/hid-pl.c
> @@ -24,10 +24,6 @@
>   */
>  
>  
> -/* #define DEBUG */
> -
> -#define debug(format, arg...) pr_debug("hid-plff: " format "\n" , ## arg)
> -
>  #include <linux/input.h>
>  #include <linux/slab.h>
>  #include <linux/module.h>
> @@ -53,14 +49,14 @@ static int hid_plff_play(struct input_dev *dev, void *data,
>  
>  	left = effect->u.rumble.strong_magnitude;
>  	right = effect->u.rumble.weak_magnitude;
> -	debug("called with 0x%04x 0x%04x", left, right);
> +	dev_dbg(&dev->dev, "called with 0x%04x 0x%04x", left, right);

Can you please use hid_dbg() instead?

Thanks,

-- 
Jiri Kosina
SUSE Labs


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

end of thread, other threads:[~2026-02-26 15:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-16 13:43 [PATCHv2 0/2] hid: hid-pl.c update Oliver Neukum
2026-02-16 13:44 ` [PATCHv2 1/2] hid: hid-pl: handle probe errors Oliver Neukum
2026-02-26 15:06   ` Jiri Kosina
2026-02-16 13:44 ` [PATCH 2/2] hid: hid-pl: eliminate private debug macro Oliver Neukum
2026-02-26 15:07   ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox