if (options[0] == '\0') {
printk(KERN_ERR "unionfs: no branches specified\n");
err = -EINVAL;
- goto out;
+ goto out_return;
}
/*
kcalloc(branches, sizeof(struct unionfs_data), GFP_KERNEL);
if (unlikely(!UNIONFS_SB(sb)->data)) {
err = -ENOMEM;
- goto out;
+ goto out_return;
}
lower_root_info->lower_paths =
kcalloc(branches, sizeof(struct path), GFP_KERNEL);
if (unlikely(!lower_root_info->lower_paths)) {
err = -ENOMEM;
- goto out;
+ /* free the underlying pointer array */
+ kfree(UNIONFS_SB(sb)->data);
+ UNIONFS_SB(sb)->data = NULL;
+ goto out_return;
}
/* now parsing a string such as "b1:b2=rw:b3=ro:b4" */
lower_root_info->lower_paths = NULL;
UNIONFS_SB(sb)->data = NULL;
}
+out_return:
return err;
}