Commit f08d714
btrfs: use kmalloc_array() for open-coded arithmetic in kmalloc()
As pointed out in the documentation, calling 'kmalloc' with open-coded
arithmetic can lead to unfortunate overflows and this particular way of
using it has been deprecated. Instead, it's preferred to use
'kmalloc_array' in cases where it might apply so an overflow check is
performed.
Note this is an API cleanup and is not fixing any overflows because in
all cases the multipliers are bounded small numbers derived from number
of items in leaves/nodes.
Signed-off-by: Miquel Sabaté Solà <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>1 parent 98077f7 commit f08d714
2 files changed
+5
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
738 | 738 | | |
739 | 739 | | |
740 | 740 | | |
741 | | - | |
742 | | - | |
| 741 | + | |
| 742 | + | |
743 | 743 | | |
744 | 744 | | |
745 | 745 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4054 | 4054 | | |
4055 | 4055 | | |
4056 | 4056 | | |
4057 | | - | |
4058 | | - | |
| 4057 | + | |
4059 | 4058 | | |
4060 | 4059 | | |
4061 | 4060 | | |
| |||
4818 | 4817 | | |
4819 | 4818 | | |
4820 | 4819 | | |
4821 | | - | |
4822 | | - | |
| 4820 | + | |
4823 | 4821 | | |
4824 | 4822 | | |
4825 | 4823 | | |
| |||
6524 | 6522 | | |
6525 | 6523 | | |
6526 | 6524 | | |
6527 | | - | |
6528 | | - | |
| 6525 | + | |
6529 | 6526 | | |
6530 | 6527 | | |
6531 | 6528 | | |
| |||
0 commit comments