Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit 6980a74

Browse files
yeyunfeng-devgregkh
authored andcommitted
reiserfs: prevent NULL pointer dereference in reiserfs_insert_item()
[ Upstream commit aacee5446a2a1aa35d0a49dab289552578657fb4 ] The variable inode may be NULL in reiserfs_insert_item(), but there is no check before accessing the member of inode. Fix this by adding NULL pointer check before calling reiserfs_debug(). Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Yunfeng Ye <[email protected]> Cc: zhengbin <[email protected]> Cc: Hu Shiyuan <[email protected]> Cc: Feilong Lin <[email protected]> Cc: Jan Kara <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 1cf357f commit 6980a74

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/reiserfs/stree.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -2249,7 +2249,8 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
22492249
/* also releases the path */
22502250
unfix_nodes(&s_ins_balance);
22512251
#ifdef REISERQUOTA_DEBUG
2252-
reiserfs_debug(th->t_super, REISERFS_DEBUG_CODE,
2252+
if (inode)
2253+
reiserfs_debug(th->t_super, REISERFS_DEBUG_CODE,
22532254
"reiserquota insert_item(): freeing %u id=%u type=%c",
22542255
quota_bytes, inode->i_uid, head2type(ih));
22552256
#endif

0 commit comments

Comments
 (0)