Kees Cook
0bb33c5fe4
dmaengine: dw-axi-dmac: Do not dereference NULL structure
...
[ Upstream commit be4d46edeee4b2459d2f53f37ada88bbfb634b6c ]
If "vdesc" is NULL, it cannot be used with vd_to_axi_desc(). Leave
"bytes" unchanged at 0. Seen under GCC 13 with -Warray-bounds:
../drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c: In function 'dma_chan_tx_status':
../drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c:329:46: warning: array subscript 0 is outside array bounds of 'struct
virt_dma_desc[46116860184273879]' [-Warray-bounds=]
329 | bytes = vd_to_axi_desc(vdesc)->length;
| ^~
Fixes: 8e55444da65c ("dmaengine: dw-axi-dmac: Support burst residue granularity")
Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Cc: Vinod Koul <vkoul@kernel.org>
Cc: dmaengine@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230127223623.never.507-kees@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-10 09:39:42 +01:00
..
2021-11-18 19:17:16 +01:00
2021-08-06 19:18:59 +05:30
2023-03-10 09:39:42 +01:00
2023-03-10 09:39:42 +01:00
2021-08-29 19:14:20 +05:30
2021-05-31 09:50:39 +05:30
2023-03-10 09:39:34 +01:00
2022-10-26 12:35:18 +02:00
2021-07-13 14:38:47 -05:00
2023-01-24 07:22:47 +01:00
2022-04-27 14:38:52 +02:00
2021-07-28 12:40:51 +05:30
2023-02-01 08:27:14 +01:00
2022-07-12 16:35:18 +02:00
2023-03-10 09:39:42 +01:00
2022-04-13 20:59:26 +02:00
2023-02-01 08:27:03 +01:00
2023-02-01 08:27:13 +01:00
2021-08-06 21:48:11 +05:30
2021-07-28 12:25:10 +05:30
2020-08-23 17:36:59 -05:00
2022-11-16 09:58:28 +01:00
2022-11-16 09:58:30 +01:00
2022-07-12 16:35:18 +02:00
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
2023-02-01 08:27:12 +01:00
2021-11-18 19:17:02 +01:00
2020-12-11 21:20:08 +05:30
2021-08-02 12:27:10 +05:30
2020-10-05 09:59:17 +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
2022-10-26 12:35:08 +02:00
2020-11-09 17:21:05 +05:30
2022-08-17 14:23:56 +02:00
2023-02-06 07:59:00 +01: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
2023-03-10 09:39:34 +01: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
2022-01-27 11:04:13 +01:00
2020-09-18 12:19:06 +05:30
2020-11-09 17:25:54 +05:30
2021-07-14 11:05:55 -05:00
2022-11-16 09:58:19 +01:00
2020-11-24 23:02:20 +05:30
2022-10-26 12:34:23 +02:00
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
2022-07-12 16:35:18 +02:00
2021-04-12 15:13:51 +05:30
2022-11-16 09:58:19 +01:00
2020-01-23 17:03:25 +05:30
2020-09-18 12:19:07 +05:30
2022-08-25 11:40:38 +02:00
2021-12-22 09:32:41 +01:00
2021-05-31 09:47:27 +05:30
2021-11-18 19:17:11 +01:00
2022-02-23 12:03:21 +01:00
2022-06-09 10:23:15 +02:00
2021-06-07 17:06:38 +05:30
2020-11-18 16:28:49 +05:30
2021-04-12 15:10:44 +05:30
2023-01-24 07:22:47 +01:00
2020-09-18 12:19:07 +05:30
2020-09-18 12:19:07 +05:30
2020-02-13 20:15:57 +05:30
2022-01-27 11:05:23 +01:00
2020-09-18 12:19:07 +05:30
2019-12-26 10:04:18 +05:30
2020-09-18 12:19:07 +05:30