于 2012年09月26日 15:07, Eric Dumazet 写道:
> On Wed, 2012-09-26 at 12:52 +0800, Gao feng wrote:
>
>> +int netlink_dump_done(struct netlink_callback *cb)
>> +{
>> +if (cb->module)
>> +module_put(cb->module);
>> +return 0;
>> +}
>> +EXPORT_SYMBOL(netlink_dump_done);
>> +
>
> No need
On Wed, 2012-09-26 at 12:52 +0800, Gao feng wrote:
> +int netlink_dump_done(struct netlink_callback *cb)
> +{
> + if (cb->module)
> + module_put(cb->module);
> + return 0;
> +}
> +EXPORT_SYMBOL(netlink_dump_done);
> +
No need to test cb->module being not NULL
int netlink_dum
On Wed, Sep 26, 2012 at 12:52:10PM +0800, Gao feng wrote:
> +
> int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
> const struct nlmsghdr *nlh,
> struct netlink_dump_control *control)
> @@ -1786,6 +1794,7 @@ int netlink_dump_start(struct sock *
于 2012年09月26日 13:41, Steffen Klassert 写道:
> On Wed, Sep 26, 2012 at 12:52:10PM +0800, Gao feng wrote:
>> +
>> int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
>> const struct nlmsghdr *nlh,
>> struct netlink_dump_control *control)
>> @@ -1786,6
I get a panic when I use ss -a and rmmod inet_diag at the
same time.
it's because netlink_dump use inet_diag_dump witch function
belongs to module inet_diag.
I search the codes and find many modules have the same problem.
We need add reference of the module witch the cb->dump belongs
to.
since C