if (!parent) {
parent = &synth_root;
}
- qemu_mutex_lock(&synth_mutex);
+ QEMU_LOCK_GUARD(&synth_mutex);
QLIST_FOREACH(tmp, &parent->child, sibling) {
if (!strcmp(tmp->name, name)) {
ret = EEXIST;
- goto err_out;
+ return ret;
}
}
/* Add the name */
node->attr, node->attr->inode);
*result = node;
ret = 0;
-err_out:
- qemu_mutex_unlock(&synth_mutex);
return ret;
}
parent = &synth_root;
}
- qemu_mutex_lock(&synth_mutex);
+ QEMU_LOCK_GUARD(&synth_mutex);
QLIST_FOREACH(tmp, &parent->child, sibling) {
if (!strcmp(tmp->name, name)) {
ret = EEXIST;
- goto err_out;
+ return ret;
}
}
/* Add file type and remove write bits */
pstrcpy(node->name, sizeof(node->name), name);
QLIST_INSERT_HEAD_RCU(&parent->child, node, sibling);
ret = 0;
-err_out:
- qemu_mutex_unlock(&synth_mutex);
return ret;
}