瀏覽代碼

selinux: fix sel_write_enforce broken return value

Return a negative error value like the rest of the entries in this function.

Cc: <stable@vger.kernel.org>
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by:  Stephen Smalley <sds@tycho.nsa.gov>
[PM: tweaked subject line]
Signed-off-by: Paul Moore <pmoore@redhat.com>
Joe Perches 10 年之前
父節點
當前提交
6436a123a1
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      security/selinux/selinuxfs.c

+ 1 - 1
security/selinux/selinuxfs.c

@@ -152,7 +152,7 @@ static ssize_t sel_write_enforce(struct file *file, const char __user *buf,
 		goto out;
 
 	/* No partial writes. */
-	length = EINVAL;
+	length = -EINVAL;
 	if (*ppos != 0)
 		goto out;