On Fri, 14 Jul 2006, [EMAIL PROTECTED] wrote:
> +int cipso_v4_validate(unsigned char **option)
> +{
> + unsigned char *opt = *option;
> + unsigned char *tag;
> + unsigned char opt_iter;
> + unsigned char err_offset = 0;
> + unsigned char locked = 0;
> + u8 opt_len;
> + u8 tag_len;
> + struct cipso_v4_doi *doi_def = NULL;
> + u32 tag_iter;
> +
> + /* XXX - caller already checks for length values that are too large */
Please don't put 'XXX' there for a normaly comment. It's supposed to
indicate that something needs attention (e.g. known bug, unresolved
question etc).
> + rcu_read_lock();
> + locked = 1;
> +validate_return:
> + if (locked)
> + rcu_read_unlock();
> + *option = opt + err_offset;
> + return err_offset;
> +}
No need for the 'locked' variable, just create a new goto label, like:
{
out_unlock:
rcu_read_unlock();
out:
*option = opt + err_offset;
return err_offset;
}
Then have the goto callers specify the correct label.
> + /* In the case of sock_create_lite(), the sock->sk field is not
> + defined yet but it is not a problem as the only users of these
> + "lite" PF_INET sockets are functions which do an accept() call
> + afterwards so we will label the socket as part of the accept(). */
Coding style standard for multiline comments is:
/*
*
*/
--
James Morris
<[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html