Len Baker
50740d5de6
dmaengine: pxa_dma: Prefer struct_size 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, use the struct_size() helper to do the arithmetic instead of the
argument "size + count * size" in the kzalloc() function.
[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments
Signed-off-by: Len Baker <len.baker@gmx.com>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
2021-10-20 18:35:22 -05:00
..
2019-06-19 17:09:55 +02:00
2021-08-06 19:18:59 +05:30
2021-08-02 12:19:52 +05:30
2021-03-16 22:58:54 +05:30
2021-08-29 19:14:20 +05:30
2021-05-31 09:50:39 +05:30
2021-08-29 19:14:20 +05:30
2020-11-16 22:42:28 +05:30
2021-07-13 14:38:47 -05:00
2021-02-01 11:27:14 +05:30
2021-06-07 12:23:47 +05:30
2021-07-28 12:40:51 +05:30
2021-08-29 19:14:21 +05:30
2021-07-05 12:05:13 -07:00
2021-07-05 12:05:13 -07:00
2021-08-31 21:50:23 +05:30
2021-08-29 19:14:19 +05:30
2021-08-29 19:14:19 +05:30
2021-08-06 21:48:11 +05:30
2021-07-28 12:25:10 +05:30
2020-08-23 17:36:59 -05:00
2021-01-08 13:57:19 +05:30
2021-01-08 13:57:19 +05:30
2021-07-28 16:19:26 +05:30
2020-09-11 17:42:12 +05:30
2020-02-13 20:15:35 +05:30
2020-09-11 17:42:12 +05:30
2021-01-26 22:45:22 +05:30
2021-04-12 15:05:58 +05:30
2020-03-11 14:56:14 +05:30
2020-12-11 21:20:08 +05:30
2021-08-02 12:27:10 +05:30
2020-10-05 09:59:17 +05:30
2015-04-02 16:10:27 +05:30
2020-07-06 14:49:22 +05:30
2020-07-06 10:24:49 +05:30
2020-06-24 13:05:01 +05:30
2021-05-10 19:51:03 +05:30
2021-01-12 18:00:39 +05:30
2020-08-29 13:50:56 -07:00
2021-07-28 12:22:05 +05:30
2020-11-09 17:21:05 +05:30
2019-06-19 17:09:55 +02:00
2019-06-05 17:37:15 +02:00
2021-08-02 12:31:19 +05:30
2021-07-23 11:20:06 +08:00
2020-10-01 10:18:59 +05:30
2020-08-23 17:36:59 -05:00
2021-04-12 17:14:53 +05:30
2021-08-29 19:14:20 +05:30
2019-06-19 17:09:55 +02:00
2021-08-29 19:14:20 +05:30
2020-06-24 13:06:15 +05:30
2020-06-15 23:08:30 -05:00
2020-12-29 10:08:00 +05:30
2021-01-26 22:58:01 +05:30
2020-09-18 12:19:06 +05:30
2020-11-09 17:25:54 +05:30
2021-07-14 11:05:55 -05:00
2020-11-24 22:55:15 +05:30
2020-11-24 23:02:20 +05:30
2019-06-05 17:36:37 +02:00
2020-11-24 22:55:15 +05:30
2020-09-18 12:19:06 +05:30
2021-07-28 12:54:50 +05:30
2021-01-12 18:00:40 +05:30
2020-09-18 12:19:06 +05:30
2021-05-10 21:38:46 +05:30
2021-04-12 15:13:51 +05:30
2021-10-20 18:35:22 -05:00
2020-01-23 17:03:25 +05:30
2020-09-18 12:19:07 +05:30
2021-07-15 17:47:38 +05:30
2020-06-30 09:34:23 -04:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:29:22 -07:00
2019-05-30 11:29:22 -07:00
2021-05-31 09:47:27 +05:30
2021-08-02 12:34:48 +05:30
2021-07-28 12:04:12 +05:30
2021-05-31 09:33:09 +05:30
2021-06-07 17:06:38 +05:30
2020-11-18 16:28:49 +05:30
2021-04-12 15:10:44 +05:30
2021-07-28 12:54:38 +05:30
2020-09-18 12:19:07 +05:30
2014-07-15 22:14:30 +05:30
2020-09-18 12:19:07 +05:30
2019-06-19 17:09:55 +02:00
2020-02-13 20:15:57 +05:30
2021-07-27 18:15:42 +05:30
2020-09-18 12:19:07 +05:30
2019-12-26 10:04:18 +05:30
2020-09-18 12:19:07 +05:30