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: <otrjrq$mee$1@blaine.gmane.org>
Date:   Tue, 7 Nov 2017 07:29:21 +0100
From:   Christophe JAILLET <christophe.jaillet@...adoo.fr>
To:     linux-kernel@...r.kernel.org
Cc:     netdev@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH 2/4] fsl/fman: Remove some useless code

Le 06/11/2017 à 22:53, Christophe JAILLET a écrit :
> There is no need to release explicitly some devm_ allocated resources.
> If the 'mac_probe()' probe function fails, they will be released
> automatically, as already done in the other error handling paths of
> this function.
>
> Also goto '_return_of_get_parent' as in the other error handling paths.
> This is useless (priv->fixed_link is NULL at this point), but at least
> it is consistent.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
>   drivers/net/ethernet/freescale/fman/mac.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c
> index c27667a005f7..ca12e28129ed 100644
> --- a/drivers/net/ethernet/freescale/fman/mac.c
> +++ b/drivers/net/ethernet/freescale/fman/mac.c
> @@ -709,11 +709,8 @@ static int mac_probe(struct platform_device *_of_dev)
>   	}
>   
>   	if (!of_device_is_available(mac_node)) {
> -		devm_iounmap(dev, priv->vaddr);
> -		__devm_release_region(dev, fman_get_mem_region(priv->fman),
> -				      res.start, res.end + 1 - res.start);
> -		devm_kfree(dev, mac_dev);
> -		return -ENODEV;
> +		err = -ENODEV;
> +		goto _return_of_get_parent;
>   	}
>   
>   	/* Get the cell-index */

Or maybe 'return -EPROBE_DEFER' was expected?

CJ


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ