fix race in completion code

This commit is contained in:
Thomas Schoebel-Theuer 2011-11-16 10:34:06 +01:00 committed by Thomas Schoebel-Theuer
parent b97aa05479
commit b53ba3124b

View File

@ -144,7 +144,6 @@ void log_flush(struct log_status *logst)
logst->count = 0; logst->count = 0;
logst->log_mref = NULL; logst->log_mref = NULL;
if (cb_info->nr_cb > 0) {
down(&cb_info->mutex); down(&cb_info->mutex);
for (i = 0; i < cb_info->nr_cb; i++) { for (i = 0; i < cb_info->nr_cb; i++) {
void (*cbf)(void *private) = cb_info->preios[i]; void (*cbf)(void *private) = cb_info->preios[i];
@ -153,7 +152,7 @@ void log_flush(struct log_status *logst)
} }
} }
up(&cb_info->mutex); up(&cb_info->mutex);
}
put_log_cb_info(cb_info); put_log_cb_info(cb_info);
} }
EXPORT_SYMBOL_GPL(log_flush); EXPORT_SYMBOL_GPL(log_flush);