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]
Date:	Wed, 27 Aug 2014 16:26:52 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	peppe.cavallaro@...com
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH (net.git)] stmmac: ptp: fix the reference clock

From: Giuseppe Cavallaro <peppe.cavallaro@...com>
Date: Tue, 26 Aug 2014 08:04:32 +0200

> @@ -638,6 +638,15 @@ static int stmmac_init_ptp(struct stmmac_priv *priv)
>  	if (!(priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp))
>  		return -EOPNOTSUPP;
>  
> +	/* Fall-back to main clock in case of no PTP ref is passed */
> +	priv->clk_ptp_ref = devm_clk_get(priv->device, "clk_ptp_ref");
> +	if (IS_ERR(priv->clk_ptp_ref)) {
> +		priv->clk_ptp_rate = clk_get_rate(priv->stmmac_clk);

This code path will leave an IS_ERR() value in clk_ptp_ref.
 ...
>  static void stmmac_release_ptp(struct stmmac_priv *priv)
>  {
> +	if (priv->clk_ptp_ref)
> +		clk_disable_unprepare(priv->clk_ptp_ref);
>  	stmmac_ptp_unregister(priv);
>  }

Which this code will erroneously pass into clk_disable_unprepare().

Please NULL the pointer out properl when devm_clk_get() errors.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ