Commit 606e7805 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

env_dpdk: assert(dev != NULL) when can_detach == true



It is not possible for dev to be NULL if can_detach is true, so modify
the if statement to reflect reality.

Signed-off-by: default avatarJim Harris <jim.harris@samsung.com>
Change-Id: I1d1a6c91325a7a54def7cc6e15e75c21cab8016b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/21088


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
parent 5411b296
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -246,7 +246,7 @@ pci_device_rte_dev_event(const char *device_name,
		}
		pthread_mutex_unlock(&g_pci_mutex);

		if (dev != NULL && can_detach) {
		if (can_detach) {
			/* if device is not attached we can remove it right away.
			 * Otherwise it will be removed at detach.
			 *
@@ -258,6 +258,7 @@ pci_device_rte_dev_event(const char *device_name,
			 * moved into the eal in the future, the deferred removal could
			 * be deleted.
			 */
			assert(dev != NULL);
			rte_eal_alarm_set(1, detach_rte_cb, dev->dev_handle);
		}
		break;