RE: [RFC 3/8] TILER-DMM: Sample TCM implementation: Simple TILER Allocator

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

 




> -----Original Message-----
> From: Shilimkar, Santosh
> Sent: Saturday, July 24, 2010 2:13 AM
> > +	kfree(tcm);
> > +	kfree(pvt);
> If only one of the allocation was successful, then you
> are freeing a NULL pointer.
> May be have something like this
> 
> 	tcm = kzalloc(sizeof(*tcm), GFP_KERNEL);
> 	if (!tcm)
> 		goto error1;
> 	pvt = kzalloc(sizeof(*pvt), GFP_KERNEL);
> 	if (!pvt)
> 		goto error2;
> 	.
> 	.
> 	.
> error1:
> 	kfree(tcm);
> error2:
> 	kfree(pvt);

Freeing a NULL pointer is always valid, and simply returns.  This is a C specification.

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