[openib-general] [PATCH] Fix underlying problem with using typedefs [WAS: Nasty bug]

Greg KH greg at kroah.com
Fri Jul 30 11:03:53 PDT 2004


On Fri, Jul 30, 2004 at 10:44:29AM -0700, Tom Duffy wrote:
> +	struct ip2pr_path_element *path_elmt;
>  	unsigned long flags;
>  
>  	TS_CHECK_NULL(path_r, -EINVAL);
> @@ -98,7 +98,7 @@
>  		return -ENOMEM;
>  	}
>  	/* if */
> -	memset(path_elmt, 0, sizeof(tIP2PR_PATH_ELEMENT_STRUCT));
> +	memset(path_elmt, 0, sizeof(struct ip2pr_path_element));

No, that should be:
	memset(path_elmt, 0, sizeof(*path_elmt));

to prevent any future change of that variable type causing a problem.

Please change your patch to use this style.

thanks,

greg k-h



More information about the general mailing list