Len Baker
67684fcbdd
drm/radeon: Prefer kcalloc over open coded arithmetic
...
As noted in the "Deprecated Interfaces, Language Features, Attributes,
and Conventions" documentation [1], size calculations (especially
multiplication) should not be performed in memory allocator (or similar)
function arguments due to the risk of them overflowing. This could lead
to values wrapping around and a smaller allocation being made than the
caller was expecting. Using those allocations could lead to linear
overflows of heap memory and other misbehaviors.
So, refactor the code a bit to use the purpose specific kcalloc()
function instead of the calculated size argument in the kzalloc()
function.
[1] https://www.kernel.org/doc/html/v5.14/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments
Signed-off-by: Len Baker <len.baker@gmx.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-09-07 13:30:50 -04:00
..
2020-03-25 11:50:48 +01:00
2020-04-30 16:48:42 -04:00
2020-11-16 15:56:34 -05:00
2021-02-17 12:52:59 +01:00
2021-04-27 18:43:42 -04:00
2021-01-06 15:43:46 +01:00
2019-12-18 16:09:13 -05:00
2021-08-02 17:21:25 -04:00
2020-11-16 15:56:35 -05:00
2019-06-10 22:30:24 +02:00
2020-11-24 12:05:42 -05:00
2019-06-10 22:30:24 +02:00
2019-06-10 22:30:24 +02:00
2017-12-20 12:00:22 -05:00
2020-11-16 15:56:35 -05:00
2021-06-22 16:51:45 -04:00
2020-11-16 15:56:35 -05:00
2017-10-30 14:16:21 +01:00
2019-06-10 22:30:24 +02:00
2019-06-10 22:30:24 +02:00
2019-06-10 22:30:24 +02:00
2020-11-16 15:56:35 -05:00
2019-06-10 22:30:24 +02:00
2020-11-16 15:56:35 -05:00
2020-11-16 15:56:35 -05:00
2020-11-16 15:56:35 -05:00
2020-11-16 15:56:34 -05:00
2020-11-16 15:56:34 -05:00
2020-11-16 15:56:34 -05:00
2021-08-05 21:18:00 -04:00
2021-05-25 23:47:24 -04:00
2019-05-21 10:50:46 +02:00
2020-11-13 00:11:53 -05:00
2019-06-10 22:30:24 +02:00
2020-04-01 14:44:43 -04:00
2018-10-15 16:16:12 -05:00
2020-11-16 15:56:34 -05:00
2021-05-13 10:45:15 -04:00
2020-11-16 15:56:34 -05:00
2021-06-22 16:51:45 -04:00
2020-11-16 15:56:34 -05:00
2021-05-13 10:45:15 -04:00
2019-06-10 22:30:24 +02:00
2021-08-05 21:18:00 -04:00
2019-12-03 16:26:59 -05:00
2021-08-02 17:21:25 -04:00
2021-06-22 16:51:45 -04:00
2021-06-22 16:51:45 -04:00
2021-06-22 16:51:45 -04:00
2021-04-09 16:44:26 -04:00
2020-11-16 15:56:34 -05:00
2021-09-07 13:30:50 -04:00
2019-06-10 22:30:24 +02:00
2020-11-16 15:56:35 -05:00
2018-08-27 11:10:19 -05:00
2021-06-22 16:51:45 -04:00
2020-11-16 15:56:35 -05:00
2020-11-16 15:56:33 -05:00
2017-08-15 14:46:07 -04:00
2021-05-10 15:46:50 +02:00
2021-02-18 16:43:09 -05:00
2021-05-25 23:47:30 -04:00
2021-05-10 18:06:45 -04:00
2020-11-16 15:56:34 -05:00
2019-05-30 11:29:21 -07:00
2020-11-16 15:56:35 -05:00
2020-11-16 15:56:33 -05:00
2019-08-13 09:09:30 +02:00
2021-02-21 14:44:44 -08:00
2019-12-05 08:44:28 +01:00
2021-01-06 15:43:46 +01:00
2020-11-13 00:11:10 -05:00
2021-06-10 11:28:09 +10:00
2020-05-19 22:31:34 +01:00
2021-08-24 15:35:47 -04:00
2020-11-16 15:56:33 -05:00
2021-07-01 00:05:18 -04:00
2019-06-10 22:30:24 +02:00
2021-05-27 15:30:59 -04:00
2021-08-10 20:13:49 +02:00
2020-11-13 00:03:49 -05:00
2020-11-16 15:56:34 -05:00
2021-08-16 16:14:12 -04:00
2021-08-02 17:21:25 -04:00
2021-05-19 22:32:24 -04:00
2021-06-06 11:19:51 +02:00
2021-01-06 15:43:46 +01:00
2021-02-18 16:43:10 -05:00
2021-08-10 20:13:49 +02:00
2021-05-10 15:46:50 +02:00
2021-08-10 20:13:49 +02:00
2020-02-13 13:08:14 +01:00
2021-01-06 15:43:46 +01:00
2020-11-16 15:56:33 -05:00
2019-11-19 10:12:54 -05:00
2021-06-06 11:19:51 +02:00
2021-02-18 16:43:10 -05:00
2021-06-30 11:56:21 +02:00
2021-06-30 11:56:21 +02:00
2021-06-02 11:07:25 +02:00
2020-11-16 15:56:33 -05:00
2021-06-22 15:29:03 +02:00
2020-11-16 15:56:35 -05:00
2021-02-18 16:43:10 -05:00
2019-06-10 22:30:24 +02:00
2019-06-10 22:30:24 +02:00
2021-06-06 11:18:19 +02:00
2019-08-06 08:21:54 +02:00
2019-06-10 22:30:24 +02:00
2021-06-02 11:07:25 +02:00
2021-06-30 11:56:21 +02:00
2021-05-26 20:56:29 +02:00
2019-06-10 22:30:24 +02:00
2021-06-10 13:47:13 +10:00
2021-02-18 16:43:09 -05:00
2021-08-02 17:21:25 -04:00
2021-06-22 16:51:45 -04:00
2021-06-22 16:51:45 -04:00
2021-08-05 21:18:00 -04:00
2021-06-22 16:51:45 -04:00
2021-01-06 15:43:46 +01:00
2019-06-10 22:30:24 +02:00
2021-06-22 16:51:45 -04:00
2020-11-16 15:56:34 -05:00
2020-11-16 15:56:34 -05:00
2019-08-13 09:09:30 +02:00
2020-11-16 15:56:35 -05:00
2019-06-10 22:30:24 +02:00
2019-06-10 22:30:24 +02:00
2021-08-05 21:18:00 -04:00
2020-11-16 15:56:34 -05:00
2020-11-16 15:56:34 -05:00
2021-05-19 22:29:40 -04:00
2020-11-16 15:56:35 -05:00
2019-06-10 22:30:24 +02:00
2021-06-22 16:51:45 -04:00
2020-11-16 15:56:35 -05:00
2021-05-13 10:45:29 -04:00
2020-10-27 17:43:42 -04:00
2020-11-13 00:12:30 -05:00
2020-11-13 00:12:30 -05:00
2020-11-16 15:56:35 -05:00
2019-06-10 22:30:24 +02:00
2020-09-22 17:37:38 -04:00
2020-09-22 17:37:38 -04:00
2019-06-10 22:30:24 +02:00
2020-09-22 17:37:38 -04:00
2021-02-18 16:43:09 -05:00
2020-11-16 15:56:35 -05:00
2020-11-16 15:56:35 -05:00