mm-kernel-device: Fix cmp to exclude subtypes

If multiple kernel device types inherit from MMKernerDevice, and those
are compared against each other, the current logic returns TRUE if the
G_OBJECT_TYPE of one of them is smaller than the other. This function is
checking for equality, so returning FALSE is enough.
This commit is contained in:
Andrew Lassalle
2020-11-05 09:07:55 +00:00
committed by Aleksander Morgado
parent 30f0824ea1
commit d7288861a5
+1 -1
View File
@@ -204,7 +204,7 @@ mm_kernel_device_cmp (MMKernelDevice *a,
g_return_val_if_fail (MM_IS_KERNEL_DEVICE (b), FALSE);
if (G_OBJECT_TYPE (a) != G_OBJECT_TYPE (b))
return G_OBJECT_TYPE (a) < G_OBJECT_TYPE (b);
return FALSE;
return (MM_KERNEL_DEVICE_GET_CLASS (a)->cmp ?
MM_KERNEL_DEVICE_GET_CLASS (a)->cmp (a, b) :