]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/libsystemd/sd-bus/bus-message.c
coccinelle: make use of SYNTHETIC_ERRNO
[thirdparty/systemd.git] / src / libsystemd / sd-bus / bus-message.c
index bd3e1f34460cbf59baa8eced1092f053f6e13bb7..e80cfc882a259ac38c4f8aa40d21a7f77ba06ad4 100644 (file)
@@ -3832,11 +3832,13 @@ static int build_struct_offsets(
                                         x = size - (n_variable * sz);
 
                                 offset = m->rindex + x;
-                                if (offset < start) {
-                                        log_debug("For type %s with alignment %zu, message specifies offset %zu which is smaller than previous end %zu + alignment = %zu",
-                                                  t, align, offset, previous, start);
-                                        return -EBADMSG;
-                                }
+                                if (offset < start)
+                                        return log_debug_errno(SYNTHETIC_ERRNO(EBADMSG),
+                                                               "For type %s with alignment %zu, message specifies offset %zu which is smaller than previous end %zu + alignment = %zu",
+                                                               t, align,
+                                                               offset,
+                                                               previous,
+                                                               start);
                         } else
                                 /* Fixed size */
                                 offset = start + k;