From: Raslan Darawsheh Date: Wed, 9 May 2018 15:57:39 +0000 (+0300) Subject: net/failsafe: fix probe cleanup X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=95e7a72f9decd1db38dfb754b485dd4ac6859def;p=dpdk.git net/failsafe: fix probe cleanup The hot-plug alarm mechanism is responsible to practically execute both plug in and out operations. It periodically tries to detect missed sub-devices to be reconfigured and clean the resources of the removed sub-devices. The hot-plug alarm is started by the failsafe probe function, and it's wrongly not stopped if failsafe instance got an error. for example when starting failsafe with a MAC option, and giving it an invalid MAC address this will lead to a NULL pointer for the dev private field. Then when the hotplug alarm is called it will try to access this pointer, which will lead to a segmentation fault. Uninstall the hot-plug alarm in case of error in probe function. Fixes: ebea83f8 ("net/failsafe: add plug-in support") Cc: stable@dpdk.org Signed-off-by: Raslan Darawsheh Acked-by: Matan Azrad Acked-by: Gaetan Rivet --- diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c index 5e7a8ba1b0..3a747c2fa0 100644 --- a/drivers/net/failsafe/failsafe.c +++ b/drivers/net/failsafe/failsafe.c @@ -226,7 +226,7 @@ fs_eth_dev_create(struct rte_vdev_device *vdev) mac); if (ret) { ERROR("Failed to set default MAC address"); - goto free_args; + goto cancel_alarm; } } } else { @@ -260,6 +260,8 @@ fs_eth_dev_create(struct rte_vdev_device *vdev) .type = RTE_INTR_HANDLE_EXT, }; return 0; +cancel_alarm: + failsafe_hotplug_alarm_cancel(dev); free_args: failsafe_args_free(dev); free_subs: