Small patch for dsp bridge code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I'm not sure if this code ever get exercised, but I found a small
problem with the 
dsp bridge driver code while debugging the kernel, and thought I'd bring
it to 
someone's attention.

Thanks,
Dan Bright

diff --git a/drivers/dsp/bridge/services/mem.c
b/drivers/dsp/bridge/services/mem.c
index 565b0b8..fff1c4a 100644
--- a/drivers/dsp/bridge/services/mem.c
+++ b/drivers/dsp/bridge/services/mem.c
@@ -355,9 +355,14 @@ void *MEM_AllocPhysMem(u32 cBytes, u32 ulAlign, OUT
u32 *pPhysicalAddress)
 		if (extPhysMemPoolEnabled) {
 			pVaMem = MEM_ExtPhysMemAlloc(cBytes, ulAlign,
 						    (u32 *)&paMem);
-		} else
+		} else {
 			pVaMem = dma_alloc_coherent(NULL, cBytes,
&paMem,
 						   GFP_ATOMIC);
+			/* dma_alloc_coherent returns ~0 on error */
+			if(pVaMem == (void *)~0)
+				pVaMem = NULL;
+		}
+
 		if (pVaMem == NULL) {
 			*pPhysicalAddress = 0;
 			GT_1trace(MEM_debugMask, GT_6CLASS,


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux