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: <CAPcyv4gfW4MdZJmueAY34D4+NzzHDrJyj1Hzg8v8fzyYphpFLw@mail.gmail.com>
Date:   Thu, 8 Sep 2016 07:56:31 -0700
From:   Dan Williams <dan.j.williams@...el.com>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     Johannes Thumshirn <jthumshirn@...e.de>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        kbuild test robot <lkp@...el.com>
Subject: Re: [PATCH] dax: use correct dev_t value

[ adding 0day robot ]

On Thu, Sep 8, 2016 at 6:53 AM, Arnd Bergmann <arnd@...db.de> wrote:
> The dev_t variable in devm_create_dax_dev() is used before it's
> first set:
>
> drivers/dax/dax.c: In function 'devm_create_dax_dev':
> drivers/dax/dax.c:205:39: error: 'dev_t' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>   inode = iget5_locked(dax_superblock, hash_32(devt + DAXFS_MAGIC, 31),
>                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/dax/dax.c:688:8: note: 'dev_t' was declared here
>
> This reorders the code to how it looks correct to me.
>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> Fixes: 3bc52c45bac2 ("dax: define a unified inode/address_space for device-dax mappings")
> ---
>  drivers/dax/dax.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dax/dax.c b/drivers/dax/dax.c
> index 68bb5e35b639..98dbbc12055f 100644
> --- a/drivers/dax/dax.c
> +++ b/drivers/dax/dax.c
> @@ -731,6 +731,8 @@ struct dax_dev *devm_create_dax_dev(struct dax_region *dax_region,
>                 goto err_minor;
>         }
>
> +       dev_t = MKDEV(MAJOR(dax_devt), minor);
> +       dev = &dax_dev->dev;
>         dax_dev->inode = dax_inode_get(&dax_dev->cdev, dev_t);
>         if (!dax_dev->inode) {
>                 rc = -ENOMEM;
> @@ -738,8 +740,6 @@ struct dax_dev *devm_create_dax_dev(struct dax_region *dax_region,
>         }
>
>         /* device_initialize() so cdev can reference kobj parent */
> -       dev_t = MKDEV(MAJOR(dax_devt), minor);
> -       dev = &dax_dev->dev;
>         device_initialize(dev);
>
>         cdev = &dax_dev->cdev;

Looks good to me.

Strange, I don't see this error with gcc-5.3.1, I assume 0day missed
it for a similar reason?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ