Re: [PATCH nf v4 1/1] netfilter: snmp: Fix one possible panic when snmp_trap_helper fail to register

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

 



Hi Feng,

2017-03-25 10:24 GMT+08:00  <gfree.wind@xxxxxxxxxxx>:
[...]
> @@ -1293,12 +1283,7 @@ static int __init nf_nat_snmp_basic_init(void)
>         BUG_ON(nf_nat_snmp_hook != NULL);
>         RCU_INIT_POINTER(nf_nat_snmp_hook, help);
>
> -       ret = nf_conntrack_helper_register(&snmp_trap_helper);
> -       if (ret < 0) {
> -               nf_conntrack_helper_unregister(&snmp_helper);
> -               return ret;
> -       }
> -       return ret;
> +       return nf_conntrack_helper_register(&snmp_trap_helper);

I think you should also remove the "int ret = 0;" statement,

static int __init nf_nat_snmp_basic_init(void)
{
     int ret = 0;  <--- Here

Otherwise, GCC will warn "unused variable".
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux