Re: [PATCH] DSPBRIDGE: Fix memory corruption in DRV_ProcFreeDMMRes

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

 



Hi,

On Tue, Feb 16, 2010 at 2:38 PM, Ameya Palande <ameya.palande@xxxxxxxxx> wrote:
> Hi Felipe,
>
> On Mon, 2010-02-15 at 16:59 +0100, Contreras Felipe (Nokia-D/Helsinki)
> wrote:
>> On Mon, Feb 15, 2010 at 04:36:31PM +0100, Ameya Palande wrote:
>> > --- a/drivers/dsp/bridge/rmgr/drv.c
>> > +++ b/drivers/dsp/bridge/rmgr/drv.c
>> > @@ -273,11 +273,14 @@ DSP_STATUS  DRV_ProcFreeDMMRes(HANDLE hPCtxt)
>> >             pDMMList = pDMMList->next;
>> >             if (pDMMRes->dmmAllocated) {
>> >                     status = PROC_UnMap(pDMMRes->hProcessor,
>> > -                            (void *)pDMMRes->ulDSPResAddr, pCtxt);
>> > +                            (void *)pDMMRes->ulDSPAddr, pCtxt);
>> > +                   /*
>> > +                    * PROC_UnMap has freed pDMMRes pointer, so don't access
>> > +                    * it now
>> > +                    */
>>
>> I don't see the need for this comment on the code.
>
> In above code segment, just by looking at PROC_Unmap() it is not
> apparent that it will deallocate "pDMMRes" thats why that comment is
> present there! I guess this whole memory corruption could have been
> easily avoided by presence of that comment ;)

Then the comment should be on PROC_Unmap() I guess.

-- 
Felipe Contreras
--
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