Skip to content

Commit

Permalink
intel_mid_dma: fix the WARN_ONs
Browse files Browse the repository at this point in the history
Moved the WARN_ON to BUG_ON, as WARN_ON if hit,
can cause null pointer derefrences

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Koul, Vinod authored and Dan Williams committed Oct 7, 2010
1 parent 576e3c3 commit 8b64922
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/dma/intel_mid_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,15 +581,15 @@ static struct dma_async_tx_descriptor *intel_mid_dma_prep_memcpy(
enum intel_mid_dma_width width = 0;

pr_debug("MDMA: Prep for memcpy\n");
WARN_ON(!chan);
BUG_ON(!chan);
if (!len)
return NULL;

mids = chan->private;
WARN_ON(!mids);
BUG_ON(!mids);

midc = to_intel_mid_dma_chan(chan);
WARN_ON(!midc);
BUG_ON(!midc);

pr_debug("MDMA:called for DMA %x CH %d Length %zu\n",
midc->dma->pci_id, midc->ch_id, len);
Expand Down

0 comments on commit 8b64922

Please sign in to comment.