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]
Date:   Mon, 29 May 2017 12:53:30 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     John Garry <john.garry@...wei.com>
Cc:     "James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        John Garry <john.garry2@...l.dcu.ie>, linuxarm@...wei.com,
        linux-scsi@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 07/22] scsi: hisi_sas: create hisi_sas_get_fw_info()

On Thu, May 25, 2017 at 2:04 PM, John Garry <john.garry@...wei.com> wrote:
> Move the functionality to retrieve the fw info into
> a dedicated device type-agnostic function,
> hisi_sas_get_fw_info().
>
> The reasoning is that this function will be required
> for future pci-based platforms.
>

> -
>         if (device_property_read_u8_array(dev, "sas-addr", hisi_hba->sas_addr,
> -                                         SAS_ADDR_SIZE))
> -               goto err_out;
> +                                         SAS_ADDR_SIZE)) {
> +               dev_err(dev, "could not get property sas-addr\n");
> +               return -ENOENT;
> +       }
>
>         if (np) {
>                 hisi_hba->ctrl = syscon_regmap_lookup_by_phandle(np,
>                                         "hisilicon,sas-syscon");
> -               if (IS_ERR(hisi_hba->ctrl))
> -                       goto err_out;
> +               if (IS_ERR(hisi_hba->ctrl)) {
> +                       dev_err(dev, "could not get syscon\n");
> +                       return -ENOENT;
> +               }

If I read this right, it will fail to work for a PCI-based driver trying to read
"sas-addr" but not the other properties that would now be hardcoded from
the PCI ID.

Maybe you just need

-          if (np) {
+         if (np && is_platform_device) {

       Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ