[U-Boot] [PATCH 2/2] disk: part_efi: fix **pgpt_pte == NULL

Mike Frysinger vapier at gentoo.org
Wed Oct 19 20:21:23 CEST 2011


On Wednesday 19 October 2011 14:04:47 Doug Anderson wrote:
> -	debug("%s: gpt-entry at 0x%08X\n", __func__, (unsigned int)*pgpt_pte);
> +	debug("%s: gpt-entry at 0x%p\n", __func__, gpt_pte);

i like %x->%p, but i think this change is incorrect.  doesn't %p output a 
leading 0x already ?

>  	/* Remember to free pte */
> -	if (*pgpt_pte != NULL) {
> -		debug("%s: Freeing pgpt_pte\n", __func__);
> -		free(*pgpt_pte);
> +	if (gpt_pte != NULL) {
> +		debug("%s: Freeing gpt_pte\n", __func__);
> +		free(gpt_pte);
>  	}

useless if() check.  free(NULL) works fine.  change it to always call free().  
there are a few more like this below.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20111019/069dd85b/attachment.pgp 


More information about the U-Boot mailing list