Эх сурвалжийг харах

dbri: check dma_alloc_coherent errors

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>
FUJITA Tomonori 16 жил өмнө
parent
commit
be37664934
1 өөрчлөгдсөн 2 нэмэгдсэн , 0 устгасан
  1. 2 0
      sound/sparc/dbri.c

+ 2 - 0
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",