]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
dbri: check dma_alloc_coherent errors
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Wed, 29 Oct 2008 22:34:39 +0000 (15:34 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Oct 2008 22:34:39 +0000 (15:34 -0700)
Needs to check for dma_alloc_coherent() allocation failure.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
sound/sparc/dbri.c

index c257ad8bdfbcf2f02055002cad0f6ed104a7db5e..23ed6f04a718c30d30db22e577974c4ee54f8190 100644 (file)
@@ -2534,6 +2534,8 @@ static int __devinit snd_dbri_create(struct snd_card *card,
        dbri->dma = dma_alloc_coherent(&op->dev,
                                       sizeof(struct dbri_dma),
                                       &dbri->dma_dvma, GFP_ATOMIC);
+       if (!dbri->dma)
+               return -ENOMEM;
        memset((void *)dbri->dma, 0, sizeof(struct dbri_dma));
 
        dprintk(D_GEN, "DMA Cmd Block 0x%p (0x%08x)\n",