On Wed, Jul 24, 2019 at 11:01:20AM +0200, Jiri Pirko wrote:
> Mon, Jul 22, 2019 at 08:31:30PM CEST, ido...@idosch.org wrote:
> > static int net_dm_trace_on_set(struct netlink_ext_ack *extack)
> > {
> >-    int rc;
> >+    int cpu, rc;
> > 
> >     if (!try_module_get(THIS_MODULE)) {
> >             NL_SET_ERR_MSG_MOD(extack, "Failed to take reference on 
> > module");
> >             return -ENODEV;
> >     }
> > 
> >+    for_each_possible_cpu(cpu) {
> >+            struct per_cpu_dm_data *data = &per_cpu(dm_cpu_data, cpu);
> >+
> >+            INIT_WORK(&data->dm_alert_work, send_dm_alert);
> >+            timer_setup(&data->send_timer, sched_send_work, 0);
> 
> So don't you want to remove this initialization from
> init_net_drop_monitor?

It's actually needed because it calls reset_per_cpu_data(), which might
trigger the timer on memory allocation error. I'll try to see if I can
get rid of it. If not, I'll add a comment so that people won't be
tempted to remove it.

Reply via email to