Skip to content

Commit 75c5318

Browse files
committed
Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma
Pull slave-dmaengine fixes from Vinod Koul: "Another week, time to send another fixes request taking time out of extended weekend for the festivities in this part of the world. We have two fixes from Sergei for rcar driver and one fixing memory leak of edma driver by Geyslan" * 'fixes' of git://git.infradead.org/users/vkoul/slave-dma: dma: edma.c: remove edma_desc leakage rcar-hpbdma: add parameter to set_slave() method rcar-hpbdma: remove shdma_free_irq() calls
2 parents 9d05746 + 2f6d8fa commit 75c5318

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

drivers/dma/edma.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg(
306306
EDMA_SLOT_ANY);
307307
if (echan->slot[i] < 0) {
308308
dev_err(dev, "Failed to allocate slot\n");
309+
kfree(edesc);
309310
return NULL;
310311
}
311312
}

drivers/dma/sh/rcar-hpbdma.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ struct hpb_dmae_chan {
9393
void __iomem *base;
9494
const struct hpb_dmae_slave_config *cfg;
9595
char dev_id[16]; /* unique name per DMAC of channel */
96+
dma_addr_t slave_addr;
9697
};
9798

9899
struct hpb_dmae_device {
@@ -432,7 +433,6 @@ hpb_dmae_alloc_chan_resources(struct hpb_dmae_chan *hpb_chan,
432433
hpb_chan->xfer_mode = XFER_DOUBLE;
433434
} else {
434435
dev_err(hpb_chan->shdma_chan.dev, "DCR setting error");
435-
shdma_free_irq(&hpb_chan->shdma_chan);
436436
return -EINVAL;
437437
}
438438

@@ -446,7 +446,8 @@ hpb_dmae_alloc_chan_resources(struct hpb_dmae_chan *hpb_chan,
446446
return 0;
447447
}
448448

449-
static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id, bool try)
449+
static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id,
450+
dma_addr_t slave_addr, bool try)
450451
{
451452
struct hpb_dmae_chan *chan = to_chan(schan);
452453
const struct hpb_dmae_slave_config *sc =
@@ -457,6 +458,7 @@ static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id, bool try)
457458
if (try)
458459
return 0;
459460
chan->cfg = sc;
461+
chan->slave_addr = slave_addr ? : sc->addr;
460462
return hpb_dmae_alloc_chan_resources(chan, sc);
461463
}
462464

@@ -468,7 +470,7 @@ static dma_addr_t hpb_dmae_slave_addr(struct shdma_chan *schan)
468470
{
469471
struct hpb_dmae_chan *chan = to_chan(schan);
470472

471-
return chan->cfg->addr;
473+
return chan->slave_addr;
472474
}
473475

474476
static struct shdma_desc *hpb_dmae_embedded_desc(void *buf, int i)
@@ -614,7 +616,6 @@ static void hpb_dmae_chan_remove(struct hpb_dmae_device *hpbdev)
614616
shdma_for_each_chan(schan, &hpbdev->shdma_dev, i) {
615617
BUG_ON(!schan);
616618

617-
shdma_free_irq(schan);
618619
shdma_chan_remove(schan);
619620
}
620621
dma_dev->chancnt = 0;

0 commit comments

Comments
 (0)