Skip to content

Commit dc8c75f

Browse files
yeyunfeng-devgregkh
authored andcommitted
reiserfs: prevent NULL pointer dereference in reiserfs_insert_item()
[ Upstream commit aacee54 ] 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 23b88b5 commit dc8c75f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/reiserfs/stree.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2246,7 +2246,8 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
22462246
/* also releases the path */
22472247
unfix_nodes(&s_ins_balance);
22482248
#ifdef REISERQUOTA_DEBUG
2249-
reiserfs_debug(th->t_super, REISERFS_DEBUG_CODE,
2249+
if (inode)
2250+
reiserfs_debug(th->t_super, REISERFS_DEBUG_CODE,
22502251
"reiserquota insert_item(): freeing %u id=%u type=%c",
22512252
quota_bytes, inode->i_uid, head2type(ih));
22522253
#endif

0 commit comments

Comments
 (0)