Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a0e3388 authored by Namhyung Kim's avatar Namhyung Kim Committed by Jan Kara
Browse files

jbd: Check return value of __getblk()



Fail journal creation if __getblk() returns NULL.  unlikely() is
added because it is called in a loop and we've been OK without
the check until now.

Signed-off-by: default avatarNamhyung Kim <namhyung@gmail.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 81a4e320
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -952,6 +952,8 @@ int journal_create(journal_t *journal)
		if (err)
			return err;
		bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize);
		if (unlikely(!bh))
			return -ENOMEM;
		lock_buffer(bh);
		memset (bh->b_data, 0, journal->j_blocksize);
		BUFFER_TRACE(bh, "marking dirty");