Ruoyu Wang
a61b4db34a
nfp: Check resource mutex allocation
...
nfp_cpp_resource_find() allocates a CPP mutex handle for the matching
resource-table entry and then reports success. nfp_resource_try_acquire()
immediately passes that handle to nfp_cpp_mutex_trylock().
However, nfp_cpp_mutex_alloc() returns NULL on failure. If that happens
for a matching table entry, the resource lookup still returns success and
the following trylock dereferences a NULL mutex pointer while opening the
resource.
nfp_resource_acquire() already treats failure to allocate the table mutex
as -ENOMEM. Do the same for the resource mutex and fail the lookup before
publishing the rest of the resource handle.
This issue was found by a static analysis checker and confirmed by
manual source review.
Fixes: f01a216157 ("nfp: add support for resources")
Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com >
Reviewed-by: Simon Horman <horms@kernel.org >
Link: https://patch.msgid.link/20260708143408.3168425-1-ruoyuw560@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com >
2026-07-21 13:06:40 +02:00
..
2026-07-10 13:03:15 +10:00
2026-07-03 15:13:50 -10:00
2026-07-03 13:54:10 +02:00
2026-07-10 09:17:00 -07:00
2026-06-16 08:53:53 -07:00
2026-07-03 07:38:17 +02:00
2026-06-26 10:47:26 -07:00
2026-07-11 09:35:33 -07:00
2026-07-13 10:09:52 -04:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-07-12 12:52:34 -07:00
2026-07-03 07:38:17 +02:00
2026-06-15 13:57:13 +05:30
2026-07-03 07:38:17 +02:00
2026-07-09 20:31:57 +02:00
2026-06-23 14:00:29 +02:00
2026-07-03 07:38:17 +02:00
2026-06-12 13:47:53 -07:00
2026-06-19 10:14:34 -07:00
2026-07-03 07:38:17 +02:00
2026-07-09 12:44:00 +02:00
2026-07-03 07:38:17 +02:00
2026-06-29 17:58:00 +02:00
2026-07-17 12:02:23 +02:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-07-17 08:52:09 -07:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-07-08 14:05:11 +02:00
2026-07-17 08:52:09 -07:00
2026-07-12 12:37:28 -07:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-06-22 08:06:13 -07:00
2026-07-02 20:54:26 -10:00
2026-06-08 21:51:12 -05:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-06-16 23:19:45 +02:00
2026-06-15 15:08:14 +05:30
2026-07-12 12:37:28 -07:00
2026-07-05 07:02:35 -04:00
2026-07-11 15:42:55 -07:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-07-05 05:29:41 -10:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-07-11 15:18:51 +02:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-07-06 17:09:30 +02:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-07-15 11:00:02 +02:00
2026-07-17 09:30:17 -07:00
2026-07-03 07:38:17 +02:00
2026-07-21 13:06:40 +02:00
2026-07-03 07:38:17 +02:00
2026-06-28 07:46:12 -07:00
2026-06-18 16:27:58 -07:00
2026-06-25 09:56:47 -07:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-07-03 05:38:12 -10:00
2026-07-10 09:51:45 -07:00
2026-07-13 12:42:17 +02:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-06-21 13:20:19 -07:00
2026-06-16 05:31:01 +05:30
2026-07-09 01:41:17 +01:00
2026-06-08 21:53:51 -05:00
2026-06-16 05:18:04 +05:30
2026-07-10 14:15:39 +02:00
2026-06-20 23:31:15 -07:00
2026-07-03 07:38:17 +02:00
2026-07-08 17:02:47 +02:00
2026-06-21 13:20:19 -07:00
2026-07-03 07:38:17 +02:00
2026-06-05 17:19:51 +02:00
2026-07-10 14:42:00 +02:00
2026-07-03 07:38:17 +02:00
2026-07-05 05:24:06 -10:00
2026-07-03 07:38:17 +02:00
2026-07-07 13:43:27 +02:00
2026-06-15 21:01:30 -04:00
2026-06-17 11:21:40 -07:00
2026-07-03 07:38:17 +02:00
2026-06-22 12:09:47 -07:00
2026-07-12 12:29:38 -07:00
2026-07-07 10:42:28 -04:00
2026-07-03 07:38:17 +02:00
2026-07-12 12:12:41 -07:00
2026-07-03 07:38:17 +02:00
2026-06-29 14:26:31 -06:00
2026-06-21 13:20:19 -07:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-06-17 11:49:00 -07:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2026-07-01 10:01:14 +02:00