Re: [PATCH 2/2] dspbridge: proc: fix a double-free on 2 error paths

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

 



On 2/17/2010 7:12 AM, Phil Carmody wrote:
On 17/02/10 01:24 +0100, ext Omar Ramirez Luna wrote:
On 2/12/2010 10:26 AM, Phil Carmody wrote:
From: Phil Carmody<ext-phil.2.carmody@xxxxxxxxx>

We free in the tail cleanup, so don't free before jumping there.

Signed-off-by: Phil Carmody<ext-phil.2.carmody@xxxxxxxxx>
---

[...]
   	}
+
+	/* paranoid - must be able to kfree this on remaining error paths */
+	pProcObject->g_pszLastCoff = NULL;
+

do we need this? afaik it should be NULL at this point, because of
kmalloc + memset (which btw should be replaced by kzalloc).

I suspected it wasn't. I confess I was a little bit rushed when
looking at that.

i.e:
MEM_AllocObject(pProcObject, struct PROC_OBJECT, PROC_SIGNATURE);
->  MEM_Calloc(sizeof(Obj), MEM_NONPAGED);
->	pMem = kmalloc(...)
	if (pMem)
		memset(pMem, 0, cBytes);

i.e. kzalloc().

   	/* Get the default executable for this board... */
   	DEV_GetDevType(hDevObject, (u32 *)&devType);
   	pProcObject->uProcessor = devType;
[...]

Regards,

I can resend without, if you like, whatever's simplest for you.


No worries, I'll remove from original.

Regards,

Omar

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