Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: Joy Zou <joy.zou@oss.nxp.com>
To: sashiko-reviews@lists.linux.dev
Cc: linux-input@vger.kernel.org, imx@lists.linux.dev,
	dmitry.torokhov@gmail.com, Frank.Li@kernel.org
Subject: Re: [PATCH v4 3/4] Input: snvs_pwrkey - use local device pointer to simple code
Date: Tue, 23 Jun 2026 18:23:19 +0800	[thread overview]
Message-ID: <ajpel+fJwMij/Olf@shlinux89> (raw)
In-Reply-To: <20260618073947.0E25C1F000E9@smtp.kernel.org>

On Thu, Jun 18, 2026 at 07:39:46AM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> 
> Pre-existing issues:
> - [High] Missing cleanup for device wakeup and wake IRQ on driver unbind causes memory leaks and re-bind warnings.
> --
> 
This is a pre-existing issue that won't be fixed in this patchset.
Will address it in a separate fix.
BR
Joy Zou
> commit aed6a36738ed05979b6e5650a6efcf08cfb05a1d
> Author: Joy Zou <joy.zou@nxp.com>
> 
> Input: snvs_pwrkey - use local device pointer to simple code
> 
> This patch introduces a local device pointer in imx_snvs_pwrkey_probe()
> to simplify the code. It replaces repeated references to the platform device
> pointer with the new local variable.
> 
> > diff --git a/drivers/input/keyboard/snvs_pwrkey.c b/drivers/input/keyboard/snvs_pwrkey.c
> > --- a/drivers/input/keyboard/snvs_pwrkey.c
> > +++ b/drivers/input/keyboard/snvs_pwrkey.c
> 
> [ ... ]
> 
> > @@ -191,27 +192,27 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
> 
> [ ... ]
> 
> > -	device_init_wakeup(&pdev->dev, pdata->wakeup);
> > -	error = dev_pm_set_wake_irq(&pdev->dev, pdata->irq);
> > +	device_init_wakeup(dev, pdata->wakeup);
> > +	error = dev_pm_set_wake_irq(dev, pdata->irq);
> 
> [Severity: High]
> This is a pre-existing issue, but since there is no remove callback in this
> driver, does this leak the wake IRQ allocation when the driver is unbound?
> 
> When the driver is unbound via sysfs, the wake_irq structure allocated by
> dev_pm_set_wake_irq() seems to remain attached to dev->power.wakeirq.
> 
> If the driver is subsequently rebound, will dev_pm_set_wake_irq() fail with
> -EEXIST and trigger a kernel warning about the wake irq already being
> initialized?
> 
> Furthermore, because device_del() does not automatically free
> dev->power.wakeirq, could this memory permanently leak when the platform
> device is destroyed?
> 
> Would it be better to use devm_pm_set_wake_irq() here to ensure proper
> cleanup?
> 
> >  	if (error)
> > -		dev_err(&pdev->dev, "irq wake enable failed.\n");
> > +		dev_err(dev, "irq wake enable failed.\n");
> >  
> >  	return 0;
> >  }
> 
> -- 
> Sashiko AI review · https://sashiko.dev/#/patchset/20260618-b4-pwrkey-v4-0-4bfda105bdf3@oss.nxp.com?part=3

  reply	other threads:[~2026-06-23 10:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-18  7:31 [PATCH v4 0/4] snvs_pwrkey - code improvements and add report event joy.zou
2026-06-18  7:31 ` [PATCH v4 1/4] Input: snvs_pwrkey - make use of dev_err_probe() joy.zou
2026-06-18  7:38   ` sashiko-bot
2026-06-23 10:22     ` Joy Zou
2026-06-18  7:31 ` [PATCH v4 2/4] Input: snvs_pwrkey - propagate error code of platform_get_irq() joy.zou
2026-06-18  7:31 ` [PATCH v4 3/4] Input: snvs_pwrkey - use local device pointer to simple code joy.zou
2026-06-18  7:39   ` sashiko-bot
2026-06-23 10:23     ` Joy Zou [this message]
2026-06-18  7:31 ` [PATCH v4 4/4] Input: snvs_pwrkey - report press event in interrupt handler joy.zou
2026-06-18  7:41   ` sashiko-bot

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=ajpel+fJwMij/Olf@shlinux89 \
    --to=joy.zou@oss.nxp.com \
    --cc=Frank.Li@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=linux-input@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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