lib/thread: fixed potential dereferencing of NULL pointer

Fixed issue indicated by Klocwork scan. 'name', which potentially
might be NULL, is passed as function parameter. Now the function
name will not point to NULL, and will be the same in interrupt
structure and in event handler.

Change-Id: I5588821139d11288a96f5041703d5b7b71890ad6
Signed-off-by: Marcin Spiewak <marcin.spiewak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17356
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Marcin Spiewak 2023-03-28 08:56:06 +00:00 committed by Konrad Sztyber
parent d69516f5e7
commit c6591af05b

View File

@ -2811,7 +2811,7 @@ spdk_interrupt_register(int efd, spdk_interrupt_fn fn,
intr->fn = fn; intr->fn = fn;
intr->arg = arg; intr->arg = arg;
ret = spdk_fd_group_add(thread->fgrp, efd, _interrupt_wrapper, intr, name); ret = spdk_fd_group_add(thread->fgrp, efd, _interrupt_wrapper, intr, intr->name);
if (ret != 0) { if (ret != 0) {
SPDK_ERRLOG("thread %s: failed to add fd %d: %s\n", SPDK_ERRLOG("thread %s: failed to add fd %d: %s\n",