Unverified Commit e52dce61 authored by Konstantin Komarov's avatar Konstantin Komarov
Browse files

fs/ntfs3: Do not allow to change label if volume is read-only

parent d27e202b
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -497,7 +497,12 @@ static ssize_t ntfs3_label_write(struct file *file, const char __user *buffer,
	int err;
	struct super_block *sb = pde_data(file_inode(file));
	ssize_t ret = count;
	u8 *label = kmalloc(count, GFP_NOFS);
	u8 *label;

	if (sb_rdonly(sb))
		return -EROFS;

	label = kmalloc(count, GFP_NOFS);

	if (!label)
		return -ENOMEM;