Diff between 72cb32651f0c77ce003648238ebd4110d3a4aa6d and f2fe7197971bb0a776e675b1cb6c97280867b38d

Changed Files

File Additions Deletions Status
tools/mgmt-tester.c +4 -16 modified

Full Patch

diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index d87d800..9d8f73e 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -325,9 +325,7 @@ static void test_condition_complete(struct test_data *data)
 #define test_bredrle_full(name, data, setup, func, timeout) \
 	do { \
 		struct test_data *user; \
-		user = malloc(sizeof(struct test_data)); \
-		if (!user) \
-			break; \
+		user = new0(struct test_data, 1); \
 		user->hciemu_type = HCIEMU_TYPE_BREDRLE; \
 		user->test_setup = setup; \
 		user->test_data = data; \
@@ -335,7 +333,6 @@ static void test_condition_complete(struct test_data *data)
 		user->expected_manufacturer = 0x003f; \
 		user->expected_supported_settings = 0x0000bfff; \
 		user->initial_settings = 0x00000080; \
-		user->unmet_conditions = 0; \
 		tester_add_full(name, data, \
 				test_pre_setup, test_setup, func, NULL, \
 				test_post_teardown, timeout, user, free); \
@@ -347,9 +344,7 @@ static void test_condition_complete(struct test_data *data)
 #define test_bredr20(name, data, setup, func) \
 	do { \
 		struct test_data *user; \
-		user = malloc(sizeof(struct test_data)); \
-		if (!user) \
-			break; \
+		user = new0(struct test_data, 1); \
 		user->hciemu_type = HCIEMU_TYPE_LEGACY; \
 		user->test_setup = setup; \
 		user->test_data = data; \
@@ -357,7 +352,6 @@ static void test_condition_complete(struct test_data *data)
 		user->expected_manufacturer = 0x003f; \
 		user->expected_supported_settings = 0x000010bf; \
 		user->initial_settings = 0x00000080; \
-		user->unmet_conditions = 0; \
 		tester_add_full(name, data, \
 				test_pre_setup, test_setup, func, NULL, \
 				test_post_teardown, 2, user, free); \
@@ -366,9 +360,7 @@ static void test_condition_complete(struct test_data *data)
 #define test_bredr(name, data, setup, func) \
 	do { \
 		struct test_data *user; \
-		user = malloc(sizeof(struct test_data)); \
-		if (!user) \
-			break; \
+		user = new0(struct test_data, 1); \
 		user->hciemu_type = HCIEMU_TYPE_BREDR; \
 		user->test_setup = setup; \
 		user->test_data = data; \
@@ -376,7 +368,6 @@ static void test_condition_complete(struct test_data *data)
 		user->expected_manufacturer = 0x003f; \
 		user->expected_supported_settings = 0x000011ff; \
 		user->initial_settings = 0x00000080; \
-		user->unmet_conditions = 0; \
 		tester_add_full(name, data, \
 				test_pre_setup, test_setup, func, NULL, \
 				test_post_teardown, 2, user, free); \
@@ -385,9 +376,7 @@ static void test_condition_complete(struct test_data *data)
 #define test_le(name, data, setup, func) \
 	do { \
 		struct test_data *user; \
-		user = malloc(sizeof(struct test_data)); \
-		if (!user) \
-			break; \
+		user = new0(struct test_data, 1); \
 		user->hciemu_type = HCIEMU_TYPE_LE; \
 		user->test_setup = setup; \
 		user->test_data = data; \
@@ -395,7 +384,6 @@ static void test_condition_complete(struct test_data *data)
 		user->expected_manufacturer = 0x003f; \
 		user->expected_supported_settings = 0x0000be1b; \
 		user->initial_settings = 0x00000200; \
-		user->unmet_conditions = 0; \
 		tester_add_full(name, data, \
 				test_pre_setup, test_setup, func, NULL, \
 				test_post_teardown, 2, user, free); \