reiserfs: Check the return value from __getblk()
authorMatthew Wilcox <willy@infradead.org>
Sun, 4 Jun 2023 11:16:06 +0000 (12:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:42:27 +0000 (09:42 +0200)
commit9720f894286efd59a715289ced87d00e5bf05563
tree335835ce705925e582fb13717e4d90d0366c5223
parent0c7e6ff75e6ce8ef9b8a04edeee733612f755078
reiserfs: Check the return value from __getblk()

[ Upstream commit ba38980add7ffc9e674ada5b4ded4e7d14e76581 ]

__getblk() can return a NULL pointer if we run out of memory or if we
try to access beyond the end of the device; check it and handle it
appropriately.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Link: https://lore.kernel.org/lkml/CAFcO6XOacq3hscbXevPQP7sXRoYFz34ZdKPYjmd6k5sZuhGFDw@mail.gmail.com/
Tested-by: butt3rflyh4ck <butterflyhuangxx@gmail.com>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") # probably introduced in 2002
Acked-by: Edward Shishkin <edward.shishkin@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/reiserfs/journal.c