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  PHC 
Open Source and information security mailing list archives
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 6 Jun 2019 14:53:23 +0200
From:   Pavel Machek <>
To:     Greg Kroah-Hartman <>
        Arnd Bergmann <>,
        James Smart <>,
        "Martin K. Petersen" <>,
        Sasha Levin <>
Subject: Re: [PATCH 4.19 237/276] scsi: lpfc: avoid uninitialized variable


> [ Upstream commit faf5a744f4f8d76e7c03912b5cd381ac8045f6ec ]
> clang -Wuninitialized incorrectly sees a variable being used without
> initialization:
> drivers/scsi/lpfc/lpfc_nvme.c:2102:37: error: variable 'localport' is uninitialized when used here
>       [-Werror,-Wuninitialized]
>                 lport = (struct lpfc_nvme_lport *)localport->private;
>                                                   ^~~~~~~~~
> drivers/scsi/lpfc/lpfc_nvme.c:2059:38: note: initialize the variable 'localport' to silence this warning
>         struct nvme_fc_local_port *localport;
>                                             ^
>                                              = NULL
> 1 error generated.
> This is clearly in dead code, as the condition leading up to it is always
> false when CONFIG_NVME_FC is disabled, and the variable is always
> initialized when nvme_fc_register_localport() got called successfully.
> Change the preprocessor conditional to the equivalent C construct, which
> makes the code more readable and gets rid of the warning.

Unfortunately, this missed "else" branch where the code was freeing
the memory with kfree(cstat)... so this introduces a memory leak.

Best regards,

> Signed-off-by: Arnd Bergmann <>
> Acked-by: James Smart <>
> Signed-off-by: Martin K. Petersen <>
> Signed-off-by: Sasha Levin <>

(cesky, pictures)

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists