[apparmor] [patch] parser: eliminate redundant/dead code

Tyler Hicks tyhicks at canonical.com
Fri Mar 18 21:25:59 UTC 2016


On 2016-03-18 10:48:01, Steve Beattie wrote:
> The debugging code for profile entries contains a check to ensure that
> it's not NULL, but the list iterator macro already ensures that the
> iteration will stop if the item is NULL, making the check redundant.
> 
> Coverity CID #55983
> 
> Signed-off-by: Steve Beattie <steve at nxnw.org>

Acked-by: Tyler Hicks <tyhicks at canonical.com>

Thanks!

> ---
>  parser/parser_misc.c |    4 ----
>  1 file changed, 4 deletions(-)
> 
> Index: b/parser/parser_misc.c
> ===================================================================
> --- a/parser/parser_misc.c
> +++ b/parser/parser_misc.c
> @@ -665,9 +665,6 @@ void debug_cod_entries(struct cod_entry
>  	printf("--- Entries ---\n");
>  
>  	list_for_each(list, item) {
> -		if (!item)
> -			printf("Item is NULL!\n");
> -
>  		printf("Mode:\t");
>  		if (HAS_CHANGE_PROFILE(item->mode))
>  			printf(" change_profile");
>  
> -- 
> Steve Beattie
> <sbeattie at ubuntu.com>
> http://NxNW.org/~steve/



> -- 
> AppArmor mailing list
> AppArmor at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20160318/cc4f4424/attachment.pgp>


More information about the AppArmor mailing list