Commit 1e28dfbf authored by John Johansen's avatar John Johansen Committed by Tim Gardner

UBUNTU: SAUCE: fix-up: kern_mount fail path should not be doing put_buffers()

Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent c2ce2d8a
......@@ -383,7 +383,7 @@ int aa_bind_mount(struct aa_label *label, struct path *path,
error = kern_path(dev_name, LOOKUP_FOLLOW|LOOKUP_AUTOMOUNT, &old_path);
if (error)
goto error;
return error;
get_buffers(buffer, old_buffer);
error = aa_path_name(path, path_flags(labels_profile(label), path), buffer, &name,
......@@ -465,7 +465,7 @@ int aa_move_mount(struct aa_label *label, struct path *path,
error = kern_path(orig_name, LOOKUP_FOLLOW, &old_path);
if (error)
goto error;
return error;
get_buffers(buffer, old_buffer);
error = aa_path_name(path, path_flags(labels_profile(label), path),
......@@ -508,12 +508,12 @@ int aa_new_mount(struct aa_label *label, const char *orig_dev_name,
const char *name = NULL, *dev_name = NULL, *info = NULL;
bool binary = true;
int error;
int requires_dev;
struct file_system_type *fstype;
int requires_dev = 0;
struct path dev_path;
dev_name = orig_dev_name;
if (type) {
struct file_system_type *fstype;
fstype = get_fs_type(type);
if (!fstype)
return -ENODEV;
......@@ -522,19 +522,17 @@ int aa_new_mount(struct aa_label *label, const char *orig_dev_name,
put_filesystem(fstype);
if (requires_dev) {
if (!dev_name || !*dev_name) {
error = -ENOENT;
goto out;
}
if (!dev_name || !*dev_name)
return -ENOENT;
error = kern_path(dev_name, LOOKUP_FOLLOW, &dev_path);
if (error)
goto error;
return error;
}
}
get_buffers(buffer, dev_buffer);
if (type) {
if (type && requires_dev) {
error = aa_path_name(&dev_path,
path_flags(labels_profile(label),
&dev_path),
......@@ -558,7 +556,6 @@ int aa_new_mount(struct aa_label *label, const char *orig_dev_name,
cleanup:
put_buffers(buffer, dev_buffer);
out:
return error;
error:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment