From cb50dc0ecb92598b76d951953cc1306a53b35bdf Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Mon, 23 Aug 2021 12:54:32 +0200 Subject: [PATCH] virscsi: Drop @tmp from virSCSIDeviceListDel Clang on Rawhide started to complain that @tmp variable in virSCSIDeviceListDel() is set but not used. This is obviously a false positive because the variable is used to free device stolen from the list. Anyway, we can do without the variable so in this specific case let's fix our code to appease Clang. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/util/virscsi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/virscsi.c b/src/util/virscsi.c index 2488b0e5f8..6a90d9002f 100644 --- a/src/util/virscsi.c +++ b/src/util/virscsi.c @@ -414,8 +414,7 @@ virSCSIDeviceListDel(virSCSIDeviceList *list, virSCSIDeviceUsedByInfoFree(dev->used_by[i]); VIR_DELETE_ELEMENT(dev->used_by, i, dev->n_used_by); } else { - g_autoptr(virSCSIDevice) tmp = NULL; - tmp = virSCSIDeviceListSteal(list, dev); + virSCSIDeviceFree(virSCSIDeviceListSteal(list, dev)); } break; } -- 2.47.2