From: Colin Ian King
Currently if the allocation of roots or tmp_ulist fails the error handling
does not free up the allocation of path causing a memory leak. Fix this by
freeing path with a call to btrfs_free_path before taking the error return
path.
Addresses-Coverity: ("Resource leak")
Fixes:
From: Colin Ian King
Currently if the allocation of roots or tmp_ulist fails the error handling
does not free up the allocation of path causing a memory leak. Fix this and
other similar leaks by moving the call of btrfs_free_path from label out
to label out_free_ulist.
Kudos to David Sterba for
From: Colin Ian King
Currently if the allocation of roots or tmp_ulist fails the error handling
does not free up the allocation of path causing a memory leak. Fix this and
other similar leaks by moving the call of btrfs_free_path from label out
to label out_free_ulist.
Kudos to David Sterba for
From: Colin Ian King
There is a spelling mistake in an extent_err error message. Fix it.
Signed-off-by: Colin Ian King
---
fs/btrfs/tree-checker.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
index 375396781fba..3d69e0f6e
From: Colin Ian King
The function btrfs_test_extent_map requires a void argument to be ANSI C
compliant and so it matches the prototype in fs/btrfs/tests/btrfs-tests.h
Cleans up sparse warning:
fs/btrfs/tests/extent-map-tests.c:346:27: warning: non-ANSI function
declaration of function 'btrfs_te
From: Colin Ian King
Trivial fix to spelling mistake of function name in btrfs_err message
Signed-off-by: Colin Ian King
---
fs/btrfs/send.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index c0074d2d7d6d..6e8184f239e0 100644
--- a/fs/bt
From: Colin Ian King
The function update_share_count is local to the source and does
not need to be in global scope, so make it static.
Cleans up sparse warning:
fs/btrfs/backref.c:219:6: warning: symbol 'update_share_count' was not
declared. Should it be static?
Signed-off-by: Colin Ian King
From: Colin Ian King
Label 'retry' is not used, remove it. Cleans up a clang build
warning:
warning: label ‘retry’ defined but not used [-Wunused-label]
Fixes: b283738ab0ad ("Revert "btrfs: qgroups: Retry after commit on getting
EDQUOT"")
Signed-off-by: Colin Ian King
---
fs/btrfs/qgroup.c |
From: Colin Ian King
Add a missing void parameter to function btrfs_test_extent_map, fixes
sparse warning:
warning: non-ANSI function declaration of function 'btrfs_test_extent_map'
Signed-off-by: Colin Ian King
---
fs/btrfs/tests/extent-map-tests.c | 2 +-
1 file changed, 1 insertion(+), 1 d
From: Colin Ian King
The check for a non-zero ret is redundant as the goto will jump to
the very next statement anyway. Remove this extraneous code.
Detected by CoverityScan, CID#1463784 ("Identical code for different
branches")
Signed-off-by: Colin Ian King
---
fs/btrfs/tests/btrfs-tests.c
From: Colin Ian King
inode is being deferenced and then inode is checked to see if it
is null, implying we potentially could have a null pointer deference
on inode.
Found with static analysis by CoverityScan, CID 1389472
Fix this by dereferencing inode only after the inode null check.
Fixes: 0
From: Colin Ian King
The check for a null inode is redundant since the function
is a callback for exportfs, which will itself crash if
dentry->d_inode or parent->d_inode is NULL. Removing the
null check makes this consistent with other file systems.
Found with static analysis by CoverityScan, C
From: Colin Ian King
The check for a null inode is redundant since the function
is a callback for exportfs, which will itself crash if
dentry->d_inode or parent->d_inode is NULL. Removing the
null check makes this consistent with other file systems.
Also remove the redundant null dir check too.
From: Colin Ian King
Variable ret is assigned to zero and is always zero throughout the
function. Thus the check for ret being less than zero is always
false and so mapping_set_error always has an -EIO error passed to
it. Hence we can remove the redundant assignment and check on ret.
Detected
From: Colin Ian King
The setting of return code ret should be based on the error code
passed into function end_extent_writepage and not on ret. Thanks
to Liu Bo for spotting this mistake in the original fix I submitted.
Detected by CoverityScan, CID#1414312 ("Logically dead code")
Fixes: 5dca6e
From: Colin Ian King
The error return variable ret is initialized to zero and then is
checked to see if it is non-zero in the if-block that follows it.
It is therefore impossible for ret to be non-zero after the if-block
hence the check is redundant and can be removed.
Detected by CoverityScan,
From: Colin Ian King
There are checks on fs_info in __btrfs_panic to avoid dereferencing a
null fs_info, however, there is a call to btrfs_crit that may also
dereference a null fs_info. Fix this by adding a check to see if fs_info
is null and only print the s_id if fs_info is non-null.
Detected
From: Colin Ian King
Don't populate the read-only array types on the stack, instead make
it static const. Makes the object code smaller by nearly 60 bytes:
Before:
textdata bss dec hex filename
905366552 64 97152 17b80 fs/btrfs/ioctl.o
After:
textdata
18 matches
Mail list logo