[PATCH v2] dma: of-dma.c: fix memory leakage

Vinod Koul vinod.koul at intel.com
Fri Feb 15 00:42:19 EST 2013


On Thu, Feb 14, 2013 at 11:16:10AM +0100, Cong Ding wrote:
> The memory allocated to ofdma might be a leakage when error occurs.
> 
> Signed-off-by: Cong Ding <dinggnu at gmail.com>
Applied, thanks

--
~Vinod
> ---
>  drivers/dma/of-dma.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c
> index 59631b2..583e50e3 100644
> --- a/drivers/dma/of-dma.c
> +++ b/drivers/dma/of-dma.c
> @@ -107,6 +107,7 @@ int of_dma_controller_register(struct device_node *np,
>  	if (!nbcells) {
>  		pr_err("%s: #dma-cells property is missing or invalid\n",
>  		       __func__);
> +		kfree(ofdma);
>  		return -EINVAL;
>  	}
>  
> -- 
> 1.7.9.5
> 


More information about the devicetree-discuss mailing list