From 2e0cb189d3340d13ba366a2c0187572dff350bc2 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 28 Aug 2020 12:58:12 +0200 Subject: [PATCH] device: fix leak in sriov_deactivate_cb() On master this code was refactored and thereby the leak was fixed. Instead of backporting that, do an original patch for nm-1-24 to fix only the leak. Fixes: 121c58f0c48d ('core: set number of SR-IOV VFs asynchronously') (cherry picked from commit a28d4a305a078c97df501c1d348159131b24efe5) --- src/devices/nm-device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index c84d908659..3890d5da2a 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -15583,10 +15583,11 @@ sriov_deactivate_cb (GError *error, gpointer user_data) NMDevice *self; gpointer reason; + nm_utils_user_data_unpack (user_data, &self, &reason); + if (nm_utils_error_is_cancelled (error, TRUE)) return; - nm_utils_user_data_unpack (user_data, &self, &reason); deactivate_ready (self, (NMDeviceStateReason) reason); }