Re: [PATCH 2/3] reiser4: fix reiser4_init_csum_tfm() error path; return real (negative) error code.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



OK.
Thanks!

On 09/14/2015 01:08 AM, Ivan Shapovalov wrote:
Signed-off-by: Ivan Shapovalov <intelfx100@xxxxxxxxx>
---

This is responsible for the oops on mount reported by Jose (also experienced
by me). The problem is that IS_ERR() works only for negative error codes,
so somewhere in the VFS an error path is incorrectly not taken.

  fs/reiser4/checksum.c | 12 +++++++-----
  1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/fs/reiser4/checksum.c b/fs/reiser4/checksum.c
index a5052b0..73d40f0 100644
--- a/fs/reiser4/checksum.c
+++ b/fs/reiser4/checksum.c
@@ -4,11 +4,13 @@
int reiser4_init_csum_tfm(struct crypto_shash **tfm)
  {
-	*tfm = crypto_alloc_shash("crc32c", 0, 0);
-	if (IS_ERR(*tfm)) {
-		*tfm = NULL;
-		return 1;
-	}
+	struct crypto_shash *new_tfm;
+
+	new_tfm = crypto_alloc_shash("crc32c", 0, 0);
+	if (IS_ERR(new_tfm))
+		return PTR_ERR(new_tfm);
+
+	*tfm = new_tfm;
  	return 0;
  }

--
To unsubscribe from this list: send the line "unsubscribe reiserfs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux File System Development]     [Linux BTRFS]     [Linux NFS]     [Linux Filesystems]     [Ext4 Filesystem]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Resources]

  Powered by Linux