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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171028171422.vkc64q2iun7ptpkc@derp-derp.lan>
Date:   Sat, 28 Oct 2017 10:15:41 -0700
From:   Moritz Fischer <mdf@...nel.org>
To:     "Gustavo A. R. Silva" <garsilva@...eddedor.com>
Cc:     Alan Tull <atull@...nel.org>, Moritz Fischer <mdf@...nel.org>,
        linux-fpga@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fpga: fpga-bridge: remove unnecessary null check in
 of_fpga_bridge_get

On Fri, Oct 27, 2017 at 08:19:51PM +0000, Gustavo A. R. Silva wrote:
> Notice that bridge = to_fpga_bridge(dev); expands to:
> 
> bridge = container_of(dev, struct fpga_bridge, dev);
> 
> and container_of is never null, so this null check is
> unnecessary.
> 
> Addresses-Coverity-ID: 1397912
> Reported-by: Alan Tull <atull@...nel.org>
> Signed-off-by: Gustavo A. R. Silva <garsilva@...eddedor.com>
Reviewed-by: Moritz Fischer <mdf@...nel.org>
> ---
>  drivers/fpga/fpga-bridge.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c
> index 9651aa5..409d1ac 100644
> --- a/drivers/fpga/fpga-bridge.c
> +++ b/drivers/fpga/fpga-bridge.c
> @@ -94,8 +94,6 @@ struct fpga_bridge *of_fpga_bridge_get(struct device_node *np,
>  		goto err_dev;
>  
>  	bridge = to_fpga_bridge(dev);
> -	if (!bridge)
> -		goto err_dev;
>  
>  	bridge->info = info;
>  
> -- 
> 2.7.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fpga" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Thanks for the fix,

Moritz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ