It is possible that another instance of the ao writer is active
when aow_close() is called. Calling ao_shutdown() in ao_close()
might disturb the other instance and lead to a segmentation fault.
Fix this by calling ao_initialize() only once during aow_init()
and never call ao_shutdown() any more.
ao_close(pawd->dev);
free(pawd);
wn->private_data = NULL;
- ao_shutdown();
}
static void aow_pre_select(struct sched *s, struct task *t)
struct private_aow_data *pawd = para_malloc(sizeof(*pawd));
struct ao_write_args_info *conf = wn->conf;
- ao_initialize();
if (conf->driver_given) {
ret = -E_AO_BAD_DRIVER;
id = ao_driver_id(conf->driver_arg);
dh[num_lines] = NULL;
w->help.detailed_help = (const char **)dh;
ao_write_cmdline_parser_free(&dummy);
- ao_shutdown();
}