diff options
-rw-r--r-- | fs/btrfs/qgroup.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 9b707ba5c6c4..5039686df6ae 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c | |||
@@ -1469,6 +1469,10 @@ int btrfs_qgroup_reserve(struct btrfs_root *root, u64 num_bytes) | |||
1469 | * be exceeded | 1469 | * be exceeded |
1470 | */ | 1470 | */ |
1471 | ulist = ulist_alloc(GFP_ATOMIC); | 1471 | ulist = ulist_alloc(GFP_ATOMIC); |
1472 | if (!ulist) { | ||
1473 | ret = -ENOMEM; | ||
1474 | goto out; | ||
1475 | } | ||
1472 | ulist_add(ulist, qgroup->qgroupid, (uintptr_t)qgroup, GFP_ATOMIC); | 1476 | ulist_add(ulist, qgroup->qgroupid, (uintptr_t)qgroup, GFP_ATOMIC); |
1473 | ULIST_ITER_INIT(&uiter); | 1477 | ULIST_ITER_INIT(&uiter); |
1474 | while ((unode = ulist_next(ulist, &uiter))) { | 1478 | while ((unode = ulist_next(ulist, &uiter))) { |
@@ -1541,6 +1545,10 @@ void btrfs_qgroup_free(struct btrfs_root *root, u64 num_bytes) | |||
1541 | goto out; | 1545 | goto out; |
1542 | 1546 | ||
1543 | ulist = ulist_alloc(GFP_ATOMIC); | 1547 | ulist = ulist_alloc(GFP_ATOMIC); |
1548 | if (!ulist) { | ||
1549 | btrfs_std_error(fs_info, -ENOMEM); | ||
1550 | goto out; | ||
1551 | } | ||
1544 | ulist_add(ulist, qgroup->qgroupid, (uintptr_t)qgroup, GFP_ATOMIC); | 1552 | ulist_add(ulist, qgroup->qgroupid, (uintptr_t)qgroup, GFP_ATOMIC); |
1545 | ULIST_ITER_INIT(&uiter); | 1553 | ULIST_ITER_INIT(&uiter); |
1546 | while ((unode = ulist_next(ulist, &uiter))) { | 1554 | while ((unode = ulist_next(ulist, &uiter))) { |