[U-Boot] [PATCH] driver: net: fsl-mc: Free dflt_dpio pointer after its usage

Prabhakar Kushwaha prabhakar.kushwaha at nxp.com
Fri Mar 18 11:45:29 CET 2016


Free dflt_dpio pointer after its usage during error handling

Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha at nxp.com>
Reported-by: Jose Rivera <german.rivera at nxp.com>
---
 drivers/net/fsl-mc/mc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c
index 7ae619d..27f352d 100644
--- a/drivers/net/fsl-mc/mc.c
+++ b/drivers/net/fsl-mc/mc.c
@@ -747,11 +747,11 @@ static int dpio_init(void)
 err_get_swp_init:
 	dpio_disable(dflt_mc_io, MC_CMD_NO_FLAGS, dflt_dpio->dpio_handle);
 err_get_enable:
-	free(dflt_dpio);
 err_get_attr:
 	dpio_close(dflt_mc_io, MC_CMD_NO_FLAGS, dflt_dpio->dpio_handle);
 	dpio_destroy(dflt_mc_io, MC_CMD_NO_FLAGS, dflt_dpio->dpio_handle);
 err_create:
+	free(dflt_dpio);
 err_malloc:
 	return err;
 }
-- 
1.9.1




More information about the U-Boot mailing list