diff mbox series

dpaa2-mac: Add a missing of_node_put after of_device_is_available

Message ID 20201206151339.44306-1-christophe.jaillet@wanadoo.fr (mailing list archive)
State Accepted
Delegated to: Netdev Maintainers
Headers show
Series dpaa2-mac: Add a missing of_node_put after of_device_is_available | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Christophe JAILLET Dec. 6, 2020, 3:13 p.m. UTC
Add an 'of_node_put()' call when a tested device node is not available.

Fixes:94ae899b2096 ("dpaa2-mac: add PCS support through the Lynx module")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Ioana Ciornei Dec. 7, 2020, 3:04 p.m. UTC | #1
On Sun, Dec 06, 2020 at 04:13:39PM +0100, Christophe JAILLET wrote:
> Add an 'of_node_put()' call when a tested device node is not available.
> 
> Fixes:94ae899b2096 ("dpaa2-mac: add PCS support through the Lynx module")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>


Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>

Thanks!

> ---
>  drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
> index 90cd243070d7..828c177df03d 100644
> --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
> +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
> @@ -269,6 +269,7 @@ static int dpaa2_pcs_create(struct dpaa2_mac *mac,
>  
>  	if (!of_device_is_available(node)) {
>  		netdev_err(mac->net_dev, "pcs-handle node not available\n");
> +		of_node_put(node);
>  		return -ENODEV;
>  	}
>  
> -- 
> 2.27.0
>
Jakub Kicinski Dec. 8, 2020, 1:58 a.m. UTC | #2
On Mon, 7 Dec 2020 15:04:58 +0000 Ioana Ciornei wrote:
> On Sun, Dec 06, 2020 at 04:13:39PM +0100, Christophe JAILLET wrote:
> > Add an 'of_node_put()' call when a tested device node is not available.
> > 
> > Fixes:94ae899b2096 ("dpaa2-mac: add PCS support through the Lynx module")
> > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>  
> 
> 
> Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>

Applied, thanks!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
index 90cd243070d7..828c177df03d 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
@@ -269,6 +269,7 @@  static int dpaa2_pcs_create(struct dpaa2_mac *mac,
 
 	if (!of_device_is_available(node)) {
 		netdev_err(mac->net_dev, "pcs-handle node not available\n");
+		of_node_put(node);
 		return -ENODEV;
 	}