static int hclgevf_client_start(struct hnae3_handle *handle)
 {
        struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle);
+       int ret;
+
+       ret = hclgevf_set_alive(handle, true);
+       if (ret)
+               return ret;
 
        mod_timer(&hdev->keep_alive_timer, jiffies + 2 * HZ);
-       return hclgevf_set_alive(handle, true);
+
+       return 0;
 }
 
 static void hclgevf_client_stop(struct hnae3_handle *handle)
 {
        set_bit(HCLGEVF_STATE_DOWN, &hdev->state);
 
+       if (hdev->keep_alive_timer.function)
+               del_timer_sync(&hdev->keep_alive_timer);
+       if (hdev->keep_alive_task.func)
+               cancel_work_sync(&hdev->keep_alive_task);
        if (hdev->service_timer.function)
                del_timer_sync(&hdev->service_timer);
        if (hdev->service_task.func)