RE: Small patch for dsp bridge code

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

 



Oops, I apologize. dma_alloc_coherent does return NULL.

Dan Bright


> -----Original Message-----
> From: linux-omap-owner@xxxxxxxxxxxxxxx [mailto:linux-omap-
> owner@xxxxxxxxxxxxxxx] On Behalf Of Hiroshi DOYU
> Sent: Friday, October 24, 2008 9:00 AM
> To: Bright, Dan
> Cc: linux-omap@xxxxxxxxxxxxxxx
> Subject: Re: Small patch for dsp bridge code
> 
> Hi Dan,
> 
> Would it be possible to explain how "dma_alloc_coherent()" returned
~0?
> 
>       Hiroshi DOYU
> 
> From: "ext Bright, Dan" <dan.bright@xxxxxxxxxxxxx>
> Subject: Small patch for dsp bridge code
> Date: Thu, 23 Oct 2008 15:03:31 -0700
> 
> > 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
> --
> 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
--
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