From: FUJITA Tomonori Date: Wed, 29 Oct 2008 22:34:39 +0000 (-0700) Subject: dbri: check dma_alloc_coherent errors X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=be376649344ba2c3d00021f8bbf64392aa01ad55;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git dbri: check dma_alloc_coherent errors Needs to check for dma_alloc_coherent() allocation failure. Signed-off-by: FUJITA Tomonori Signed-off-by: David S. Miller --- diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c index c257ad8bdfbc..23ed6f04a718 100644 --- a/sound/sparc/dbri.c +++ b/sound/sparc/dbri.c @@ -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",