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 Liping,

> -----Original Message-----
> From: Liping Zhang [mailto:zlpnobody@xxxxxxxxx]
> Sent: Saturday, March 25, 2017 4:17 PM
> To: gfree.wind@xxxxxxxxxxx
> Cc: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>; Netfilter Developer Mailing List
> <netfilter-devel@xxxxxxxxxxxxxxx>; Gao Feng <fgao@xxxxxxxxxx>
> Subject: Re: [PATCH nf v4 1/1] netfilter: snmp: Fix one possible panic when
> snmp_trap_helper fail to register
> 
> 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".

Thanks.
I didn't see the warning during compiling.
I think it should be overlapped because I pull the upstream.
There are other changes.

Next time, I would only touch the changed files and compile.
Thanks again.

Feng





--
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