dma40: handle failure to allocate first LCLA
authorRabin Vincent <rabin.vincent@stericsson.com>
Tue, 25 Jan 2011 10:18:32 +0000 (11:18 +0100)
committerDan Williams <dan.j.williams@intel.com>
Mon, 31 Jan 2011 06:27:21 +0000 (22:27 -0800)
Acked-by: Per Forlin <per.forlin@stericsson.com>
Acked-by: Jonas Aaberg <jonas.aberg@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dma/ste_dma40.c

index 4ec96ac1e41a81a4125d7624da65fcffd3d82327..b8cce85a95583cac93fe26e855751b0d3d7f8262 100644 (file)
@@ -538,6 +538,10 @@ static void d40_log_lli_to_lcxa(struct d40_chan *chan, struct d40_desc *desc)
                               curr_lcla);
 
        lli_current++;
+
+       if (curr_lcla < 0)
+               goto out;
+
        for (; lli_current < lli_len; lli_current++) {
                unsigned int lcla_offset = chan->phy_chan->num * 1024 +
                                           8 * curr_lcla * 2;
@@ -567,6 +571,7 @@ static void d40_log_lli_to_lcxa(struct d40_chan *chan, struct d40_desc *desc)
                }
        }
 
+out:
        desc->lli_current = lli_current;
 }