From: FUJITA Tomonori Date: Wed, 29 Oct 2008 22:34:39 +0000 (-0700) Subject: dbri: check dma_alloc_coherent errors X-Git-Tag: v3.12-rc1~17385^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=be376649344ba2c3d00021f8bbf64392aa01ad55;p=kernel%2Fkernel-generic.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 c257ad8..23ed6f0 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",