From: FUJITA Tomonori Date: Wed, 29 Oct 2008 22:34:39 +0000 (-0700) Subject: dbri: check dma_alloc_coherent errors X-Git-Tag: v2.6.28-rc3~24^2~3 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=be376649344ba2c3d00021f8bbf64392aa01ad55;p=linux-2.6-omap-h63xx.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 c257ad8bdfb..23ed6f04a71 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",