dma: of-dma.c: fix memory leakage

The memory allocated to ofdma might be a leakage when error occurs.

Signed-off-by: Cong Ding <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
This commit is contained in:
Cong Ding 2013-02-14 11:16:10 +01:00 • committed by Vinod Koul
commit e68b1130df

View file

@ -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;
}