Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218789
b: refs/heads/master
c: 819504f
h: refs/heads/master
i:
  218787: 7d3ebd2
v: v3
  • Loading branch information
Rabin Vincent authored and Dan Williams committed Oct 7, 2010
1 parent d83b13e commit 386e67b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a2c15fa4c122558472f8041515072218c8652c7e
refs/heads/master: 819504f4861a5bc1e25c82409956388bb79fb635
17 changes: 13 additions & 4 deletions trunk/drivers/dma/ste_dma40.c
Original file line number Diff line number Diff line change
Expand Up @@ -1728,6 +1728,8 @@ struct dma_async_tx_descriptor *stedma40_memcpy_sg(struct dma_chan *chan,

return &d40d->txd;
err:
if (d40d)
d40_desc_free(d40c, d40d);
spin_unlock_irqrestore(&d40c->lock, flags);
return NULL;
}
Expand Down Expand Up @@ -1939,8 +1941,9 @@ static struct dma_async_tx_descriptor *d40_prep_memcpy(struct dma_chan *chan,
err_fill_lli:
dev_err(&d40c->chan.dev->device,
"[%s] Failed filling in PHY LLI\n", __func__);
d40_pool_lli_free(d40d);
err:
if (d40d)
d40_desc_free(d40c, d40d);
spin_unlock_irqrestore(&d40c->lock, flags);
return NULL;
}
Expand Down Expand Up @@ -2079,10 +2082,9 @@ static struct dma_async_tx_descriptor *d40_prep_slave_sg(struct dma_chan *chan,

spin_lock_irqsave(&d40c->lock, flags);
d40d = d40_desc_get(d40c);
spin_unlock_irqrestore(&d40c->lock, flags);

if (d40d == NULL)
return NULL;
goto err;

if (d40c->log_num != D40_PHY_CHAN)
err = d40_prep_slave_sg_log(d40d, d40c, sgl, sg_len,
Expand All @@ -2095,7 +2097,7 @@ static struct dma_async_tx_descriptor *d40_prep_slave_sg(struct dma_chan *chan,
"[%s] Failed to prepare %s slave sg job: %d\n",
__func__,
d40c->log_num != D40_PHY_CHAN ? "log" : "phy", err);
return NULL;
goto err;
}

d40d->txd.flags = dma_flags;
Expand All @@ -2104,7 +2106,14 @@ static struct dma_async_tx_descriptor *d40_prep_slave_sg(struct dma_chan *chan,

d40d->txd.tx_submit = d40_tx_submit;

spin_unlock_irqrestore(&d40c->lock, flags);
return &d40d->txd;

err:
if (d40d)
d40_desc_free(d40c, d40d);
spin_unlock_irqrestore(&d40c->lock, flags);
return NULL;
}

static enum dma_status d40_tx_status(struct dma_chan *chan,
Expand Down

0 comments on commit 386e67b

Please sign in to comment.