xfs:xfs_dir2_node.c: pointer use before check for null
PATCH 1/1 xfs:xfs_dir2_node.c: pointer use before check for null
Reorder of assert and args pointer dereference.
Found by Linux Driver Verification project (linuxtesting.org) - PVS-Studio analyzer.
--- fs/xfs/xfs_dir2_node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_dir2_node.c +1 -1
@@ -1365,8 +1365,8 @@ xfs_dir2_leafn_split(* Allocate space for a new leaf node. */ args = state->args; - mp = args->dp->i_mount;ASSERT (args !=NULL ); + mp = args->dp->i_mount;ASSERT (oldblk->magic ==XFS_DIR2_LEAFN_MAGIC ); error =xfs_da_grow_inode (args, &blkno);if (error) {
Signature · 1 line
1.8.3.1
Quoted 15 lines · Denis Efremov
Reorder of assert and args pointer dereference.
Found by Linux Driver Verification project (linuxtesting.org) - PVS-Studio analyzer.
Signed-off-by Denis Efremov <[email protected]>--- fs/xfs/xfs_dir2_node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/xfs/xfs_dir2_node.c +0
-0
fs/xfs/xfs_dir2_node.c xfs_dir2_leafn_split( · line 1369
Quoted 6 lines
fs/xfs/xfs_dir2_node.c +1
-1@@ -1365,8 +1365,8 @@ xfs_dir2_leafn_split(* Allocate space for a new leaf node. */ args = state->args; - mp = args->dp->i_mount;ASSERT (args !=NULL ); + mp = args->dp->i_mount;
Just remove the ASSERT. Either way we are going to panic.
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]
PATCH v2 1/1 xfs:xfs_dir2_node.c: pointer use before check for null
ASSERT on args takes place after args dereference. This assertion is redundant since we are going to panic anyway.
Found by Linux Driver Verification project (linuxtesting.org) - PVS-Studio analyzer.
--- fs/xfs/xfs_dir2_node.c | 1 - 1 file changed, 1 deletion(-)
fs/xfs/xfs_dir2_node.c +0 -1
@@ -1366,7 +1366,6 @@ xfs_dir2_leafn_split(*/ args = state->args; mp = args->dp->i_mount; -ASSERT (args !=NULL );ASSERT (oldblk->magic ==XFS_DIR2_LEAFN_MAGIC ); error =xfs_da_grow_inode (args, &blkno);if (error) {
Signature · 1 line
1.8.3.1
Quoted 7 lines · Denis Efremov
ASSERT on args takes place after args dereference. This assertion is redundant since we are going to panic anyway.
Found by Linux Driver Verification project (linuxtesting.org) - PVS-Studio analyzer.
Signed-off-by Denis Efremov <[email protected]>
Looks good.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Ben Myers
AppliedQuoted 4 lines · Ben Myers
Quoted 3 lines · Denis Efremov
ASSERT on args takes place after args dereference. This assertion is redundant since we are going to panic anyway.
Quoted 8 lines
Quoted 4 lines
Found by Linux Driver Verification project (linuxtesting.org) - PVS-Studio analyzer.
Signed-off-by Denis Efremov <[email protected]>Looks good.
Reviewed-by Ben Myers <[email protected]>
Applied. Thanks Denis.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs