Linux Input/HID development
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Linmao Li <lilinmao@kylinos.cn>
Cc: Haotian Zhang <vulab@iscas.ac.cn>,
	 Tomohiro Yoshidomi <sylph23k@gmail.com>,
	David Rheinsberg <david@readahead.eu>,
	 linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] Input: psxpad-spi - set driver data before use
Date: Fri, 24 Jul 2026 18:46:35 -0700	[thread overview]
Message-ID: <amQVSXuehlUKEeCy@google.com> (raw)
In-Reply-To: <20260721055551.1714965-1-lilinmao@kylinos.cn>

Hi Linmao,

On Tue, Jul 21, 2026 at 01:55:51PM +0800, Linmao Li wrote:
> psxpad_spi_suspend() retrieves the controller state with
> spi_get_drvdata(), but probe never stores it, so suspend dereferences a
> NULL pointer. Store it during probe.
> 
> Fixes: 8be193c7b1f4 ("Input: add support for PlayStation 1/2 joypads connected via SPI")
> Cc: stable@vger.kernel.org
> Signed-off-by: Linmao Li <lilinmao@kylinos.cn>
> ---
>  drivers/input/joystick/psxpad-spi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/input/joystick/psxpad-spi.c b/drivers/input/joystick/psxpad-spi.c
> index f902a56d011f..b1ab2486bb0d 100644
> --- a/drivers/input/joystick/psxpad-spi.c
> +++ b/drivers/input/joystick/psxpad-spi.c
> @@ -301,6 +301,7 @@ static int psxpad_spi_probe(struct spi_device *spi)
>  	/* input poll device settings */
>  	pad->idev = idev;
>  	pad->spi = spi;
> +	spi_set_drvdata(spi, pad);

I moved the assignment to the end of probe and applied, thank you.

-- 
Dmitry

      parent reply	other threads:[~2026-07-25  1:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21  5:55 [PATCH] Input: psxpad-spi - set driver data before use Linmao Li
2026-07-21  6:05 ` sashiko-bot
2026-07-25  1:46 ` Dmitry Torokhov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=amQVSXuehlUKEeCy@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=david@readahead.eu \
    --cc=lilinmao@kylinos.cn \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=sylph23k@gmail.com \
    --cc=vulab@iscas.ac.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox