]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virscsi: Drop @tmp from virSCSIDeviceListDel
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 23 Aug 2021 10:54:32 +0000 (12:54 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 26 Aug 2021 07:16:44 +0000 (09:16 +0200)
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 <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/util/virscsi.c

index 2488b0e5f833b319bbb7914995d7c796cf60aa37..6a90d9002fc437b26b0a24dd80eb54af1ff46c82 100644 (file)
@@ -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;
         }