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: <CAKz_xw0fHgVBLdEoEoQ7OSAgBcvYBAowV0obWLsDUGNPotP55Q@mail.gmail.com>
Date:   Thu, 20 Feb 2020 17:50:03 +1100
From:   Evan Benn <evanbenn@...omium.org>
To:     Guenter Roeck <linux@...ck-us.net>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Julius Werner <jwerner@...omium.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
        Marcin Juszkiewicz <marcin.juszkiewicz@...aro.org>,
        Catalin Marinas <catalin.marinas@....com>,
        Olof Johansson <olof@...om.net>,
        Leonard Crestez <leonard.crestez@....com>,
        Jonathan Cameron <Jonathan.Cameron@...wei.com>,
        Dinh Nguyen <dinguyen@...nel.org>,
        linux-arm-kernel@...ts.infradead.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Will Deacon <will@...nel.org>, linux-watchdog@...r.kernel.org,
        Rob Herring <robh@...nel.org>,
        Wim Van Sebroeck <wim@...ux-watchdog.org>,
        Clément Péron <peron.clem@...il.com>,
        Shawn Guo <shawnguo@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Anson Huang <Anson.Huang@....com>
Subject: Re: [PATCH 2/2] watchdog: Add new arm_smc_wdt watchdog driver

> > +     if ((int)res->a0 == PSCI_RET_NOT_SUPPORTED)
> > +             return -ENOTSUPP;
>
> -ENODEV would be better here.
>
> > +     if ((int)res->a0 == PSCI_RET_INVALID_PARAMS)
> > +             return -EINVAL;
> > +     if ((int)res->a0 < 0)
> > +             return -EIO;

In fixing this I found drivers/firmware/psci/psci.c:145
Which also translates psci codes to errno codes, but uses EOPNOTSUPP:

    switch (errno) {
    case PSCI_RET_SUCCESS:
        return 0;
    case PSCI_RET_NOT_SUPPORTED:
        return -EOPNOTSUPP;
    case PSCI_RET_INVALID_PARAMS:
    case PSCI_RET_INVALID_ADDRESS:
        return -EINVAL;
    case PSCI_RET_DENIED:
        return -EPERM;
    };

    return -EINVAL;

Are these more appropriate?

Evan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ