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: <20201107140953.1f04c04e@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Sat, 7 Nov 2020 14:09:53 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Yu Kuai <yukuai3@...wei.com>
Cc:     <madalin.bucur@....com>, <davem@...emloft.net>,
        <florinel.iordache@....com>, <netdev@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <yi.zhang@...wei.com>
Subject: Re: [PATCH V3] fsl/fman: add missing put_devcie() call in
 fman_port_probe()

On Sat, 7 Nov 2020 17:09:25 +0800 Yu Kuai wrote:
> if of_find_device_by_node() succeed, fman_port_probe() doesn't have a
> corresponding put_device(). Thus add jump target to fix the exception
> handling for this function implementation.
> 
> Fixes: 0572054617f3 ("fsl/fman: fix dereference null return value")
> Signed-off-by: Yu Kuai <yukuai3@...wei.com>

> @@ -1792,20 +1792,20 @@ static int fman_port_probe(struct platform_device *of_dev)
>  	if (!fm_node) {
>  		dev_err(port->dev, "%s: of_get_parent() failed\n", __func__);
>  		err = -ENODEV;
> -		goto return_err;
> +		goto free_port;

And now you no longer put port_node if jumping from here...

Also does the reference to put_device() not have to be released when
this function succeeds?

>  	}

> @@ -1896,7 +1895,9 @@ static int fman_port_probe(struct platform_device *of_dev)
>  
>  	return 0;
>  
> -return_err:
> +put_device:
> +	put_device(&fm_pdev->dev);
> +put_node:
>  	of_node_put(port_node);
>  free_port:
>  	kfree(port);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ