Commit 67d8b3a
btrfs: add ASSERTs on prealloc in qgroup functions
The prealloc variable in these functions is always initialized to
NULL. Whenever we allocate memory for it, if it fails then NULL is
preserved, otherwise we delegate the ownership of the pointer to
add_qgroup_rb() and set it right after to NULL.
Since in any case the pointer ends up being NULL at the end of its
usage, we can safely remove calls to kfree() for it, while adding an
ASSERT as an extra check.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent ad286e5 commit 67d8b3a
1 file changed
+23
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1263 | 1263 | | |
1264 | 1264 | | |
1265 | 1265 | | |
1266 | | - | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
1267 | 1274 | | |
1268 | 1275 | | |
1269 | 1276 | | |
| |||
1695 | 1702 | | |
1696 | 1703 | | |
1697 | 1704 | | |
1698 | | - | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
1699 | 1711 | | |
1700 | 1712 | | |
1701 | 1713 | | |
| |||
3303 | 3315 | | |
3304 | 3316 | | |
3305 | 3317 | | |
3306 | | - | |
| 3318 | + | |
3307 | 3319 | | |
3308 | 3320 | | |
3309 | 3321 | | |
| |||
3544 | 3556 | | |
3545 | 3557 | | |
3546 | 3558 | | |
3547 | | - | |
| 3559 | + | |
| 3560 | + | |
| 3561 | + | |
| 3562 | + | |
| 3563 | + | |
| 3564 | + | |
| 3565 | + | |
| 3566 | + | |
3548 | 3567 | | |
3549 | 3568 | | |
3550 | 3569 | | |
| |||
0 commit comments