]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
btrfs: clean up NULL checks in qgroup_unreserve_range()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 23 Oct 2020 11:26:33 +0000 (14:26 +0300)
committerDavid Sterba <dsterba@suse.com>
Thu, 5 Nov 2020 12:02:20 +0000 (13:02 +0100)
commitf07728d541ebefcf3d2ec7bc99a3bffd052d9f90
tree7b1e6c682ee89e4f751c2d77c43eeeb1cf85e5c0
parentfca3a45d08782a2bb85e048fb8e3128b1388d7b7
btrfs: clean up NULL checks in qgroup_unreserve_range()

Smatch complains that this code dereferences "entry" before checking
whether it's NULL on the next line.  Fortunately, rb_entry() will never
return NULL so it doesn't cause a problem.  We can clean up the NULL
checking a bit to silence the warning and make the code more clear.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/qgroup.c