diff mbox series

[BlueZ,v1] shared/util: Fix build error on malloc0

Message ID 20240510150919.1492039-1-luiz.dentz@gmail.com
State New
Headers show
Series [BlueZ,v1] shared/util: Fix build error on malloc0 | expand

Commit Message

Luiz Augusto von Dentz May 10, 2024, 3:09 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This fixes the parameter order of calloc which causes the following
error on recent gcc:

CC    client/mgmt.o
In file included from client/mgmt.c:43:
client/mgmt.c: In function ‘cmd_add_ext_adv_params’:
client/mgmt.c:5057:28: error: ‘calloc’ sizes specified with ‘sizeof’ in
the earlier argument and not in the later argument
[-Werror=calloc-transposed-args]
 5057 |     cp = malloc0(sizeof(*cp));
   |
---
 src/shared/util.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

bluez.test.bot@gmail.com May 10, 2024, 3:13 p.m. UTC | #1
This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----

error: patch failed: src/shared/util.h:85
error: src/shared/util.h: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch

Please resolve the issue and submit the patches again.


---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/src/shared/util.h b/src/shared/util.h
index a8ba23499289..bd71577d60c0 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -85,7 +85,7 @@  do {						\
 	}))
 
 #define newa(t, n) ((t*) alloca(sizeof(t)*(n)))
-#define malloc0(n) (calloc((n), 1))
+#define malloc0(n) (calloc(1, (n)))
 
 char *strdelimit(char *str, char *del, char c);
 int strsuffix(const char *str, const char *suffix);