lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240314151846.u3r3eaklrl3hf7pi@dhruva>
Date: Thu, 14 Mar 2024 20:48:46 +0530
From: Dhruva Gole <d-gole@...com>
To: "Rafael J. Wysocki" <rafael@...nel.org>
CC: Tony Lindgren <tony@...mide.com>, <theo.lebrun@...tlin.com>,
        Sibi Sankar
	<quic_sibis@...cinc.com>,
        Viresh Kumar <viresh.kumar@...aro.org>, <linux-pm@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, Ulf Hansson
	<ulf.hansson@...aro.org>
Subject: Re: [PATCH] PM: wakeup: Add a missing return case in init_wakeup

Hi,

On Mar 14, 2024 at 15:01:36 +0100, Rafael J. Wysocki wrote:
> On Thu, Mar 14, 2024 at 8:55 AM Dhruva Gole <d-gole@...com> wrote:
> >
> > The device_wakeup_disable call can return an error if no dev exists
> > however this was being ignored. Catch this return value and propagate it
> > onward in device_init_wakeup.
> 
> Why does this matter to the callers of device_init_wakeup()?

If atall !dev->power.can_wakeup then the caller should know something is
funny right?

> 
> >
> > Signed-off-by: Dhruva Gole <d-gole@...com>
> > ---
> >  include/linux/pm_wakeup.h | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h
> > index 6eb9adaef52b..64c7db35e693 100644
> > --- a/include/linux/pm_wakeup.h
> > +++ b/include/linux/pm_wakeup.h
> > @@ -232,14 +232,15 @@ static inline void pm_wakeup_hard_event(struct device *dev)
> >   */
> >  static inline int device_init_wakeup(struct device *dev, bool enable)
> >  {
> > +       int ret;
> >         if (enable) {
> >                 device_set_wakeup_capable(dev, true);
> > -               return device_wakeup_enable(dev);
> > +               ret = device_wakeup_enable(dev);
> >         } else {
> > -               device_wakeup_disable(dev);
> > +               ret = device_wakeup_disable(dev);
> >                 device_set_wakeup_capable(dev, false);
> > -               return 0;
> >         }
> > +       return ret;
> >  }
> >
> >  #endif /* _LINUX_PM_WAKEUP_H */
> >
> > base-commit: 9bb9b28d0568991b1d63e66fe75afa5f97ad1156
> > --
> > 2.34.1
> >

-- 
Best regards,
Dhruva Gole <d-gole@...com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ