btrfs: add missing sctx check in cleanup path in btrfs_ioctl_send()

Add sctx NULL check in the for loop condition of the sort_clone_roots
cleanup path for consistency with the else branch.

Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Hongling Zeng 2026-07-14 09:28:50 +08:00 committed by David Sterba
parent 49ba3a3c0d
commit f18dbadb52

View File

@ -8250,7 +8250,7 @@ long btrfs_ioctl_send(struct btrfs_root *send_root, const struct btrfs_ioctl_sen
}
if (sort_clone_roots) {
for (i = 0; i < sctx->clone_roots_cnt; i++) {
for (i = 0; sctx && i < sctx->clone_roots_cnt; i++) {
btrfs_root_dec_send_in_progress(
sctx->clone_roots[i].root);
btrfs_put_root(sctx->clone_roots[i].root);