diff options
author | Vinod Koul <vinod.koul@intel.com> | 2018-04-10 08:55:14 +0530 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2018-04-10 08:55:14 +0530 |
commit | 238eed66be899ab4d576c60d446f595c64e4b557 (patch) | |
tree | d79ae939230ce5da411c4a6c1857e47c117477fa /drivers/dma | |
parent | 62065132eec7dc1e5e8ea7a11d26786935d84856 (diff) | |
parent | f31b323675c11e41c117a4d31be3e93a9f79a07c (diff) |
Merge branch 'topic/edma' into for-linus
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/edma.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c index 948df1ab5f1a..85ea92fcea54 100644 --- a/drivers/dma/edma.c +++ b/drivers/dma/edma.c @@ -1876,6 +1876,11 @@ static void edma_dma_init(struct edma_cc *ecc, bool legacy_mode) if (memcpy_channels) { m_ddev = devm_kzalloc(ecc->dev, sizeof(*m_ddev), GFP_KERNEL); + if (!m_ddev) { + dev_warn(ecc->dev, "memcpy is disabled due to OoM\n"); + memcpy_channels = NULL; + goto ch_setup; + } ecc->dma_memcpy = m_ddev; dma_cap_zero(m_ddev->cap_mask); @@ -1903,6 +1908,7 @@ static void edma_dma_init(struct edma_cc *ecc, bool legacy_mode) dev_info(ecc->dev, "memcpy is disabled\n"); } +ch_setup: for (i = 0; i < ecc->num_channels; i++) { struct edma_chan *echan = &ecc->slave_chans[i]; echan->ch_num = EDMA_CTLR_CHAN(ecc->id, i); |