diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-06 19:41:06 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-06 19:41:06 -0500 |
commit | 1071ec7bc2dabd0a9d12a1ae5570f4fd3ba944ca (patch) | |
tree | 3f889877ae180066a8e682d915680f240fbfd6ec /tools | |
parent | c287322c3aadf45ee15339bffdbc2e9117b9cc7a (diff) | |
parent | 425792266a40189e0b3fec02cb59a69935d8c58c (diff) |
Merge tag 'char-misc-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc patches from Greg KH:
"Here's the big char/misc driver patchset for 3.13-rc1.
Lots of stuff in here, including some new drivers for Intel's "MIC"
co-processor devices, and a new eeprom driver. Other things include
the driver attribute cleanups, extcon driver updates, hyperv updates,
and a raft of other miscellaneous driver fixes.
All of these have been in linux-next for a while"
* tag 'char-misc-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (121 commits)
misc: mic: Fixes for randconfig build errors and warnings.
tifm: fix error return code in tifm_7xx1_probe()
w1-gpio: Use devm_* functions
w1-gpio: Detect of_gpio_error for first gpio
uio: Pass pointers to virt_to_page(), not integers
uio: fix memory leak
misc/at24: avoid infinite loop on write()
misc/93xx46: avoid infinite loop on write()
misc: atmel_pwm: add deferred-probing support
mei: wd: host_init propagate error codes from called functions
mei: replace stray pr_debug with dev_dbg
mei: bus: propagate error code returned by mei_me_cl_by_id
mei: mei_cl_link remove duplicated check for open_handle_count
mei: print correct device state during unexpected reset
mei: nfc: fix memory leak in error path
lkdtm: add tests for additional page permissions
lkdtm: adjust recursion size to avoid warnings
lkdtm: isolate stack corruption test
mei: move host_clients_map cleanup to device init
mei: me: downgrade two errors to debug level
...
Diffstat (limited to 'tools')
-rw-r--r-- | tools/hv/hv_kvp_daemon.c | 29 | ||||
-rw-r--r-- | tools/hv/hv_vss_daemon.c | 8 |
2 files changed, 19 insertions, 18 deletions
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c index 8fd9ec66121c..b8d6d541d854 100644 --- a/tools/hv/hv_kvp_daemon.c +++ b/tools/hv/hv_kvp_daemon.c | |||
@@ -89,6 +89,7 @@ static char *processor_arch; | |||
89 | static char *os_build; | 89 | static char *os_build; |
90 | static char *os_version; | 90 | static char *os_version; |
91 | static char *lic_version = "Unknown version"; | 91 | static char *lic_version = "Unknown version"; |
92 | static char full_domain_name[HV_KVP_EXCHANGE_MAX_VALUE_SIZE]; | ||
92 | static struct utsname uts_buf; | 93 | static struct utsname uts_buf; |
93 | 94 | ||
94 | /* | 95 | /* |
@@ -1367,7 +1368,7 @@ setval_error: | |||
1367 | } | 1368 | } |
1368 | 1369 | ||
1369 | 1370 | ||
1370 | static int | 1371 | static void |
1371 | kvp_get_domain_name(char *buffer, int length) | 1372 | kvp_get_domain_name(char *buffer, int length) |
1372 | { | 1373 | { |
1373 | struct addrinfo hints, *info ; | 1374 | struct addrinfo hints, *info ; |
@@ -1381,12 +1382,12 @@ kvp_get_domain_name(char *buffer, int length) | |||
1381 | 1382 | ||
1382 | error = getaddrinfo(buffer, NULL, &hints, &info); | 1383 | error = getaddrinfo(buffer, NULL, &hints, &info); |
1383 | if (error != 0) { | 1384 | if (error != 0) { |
1384 | strcpy(buffer, "getaddrinfo failed\n"); | 1385 | snprintf(buffer, length, "getaddrinfo failed: 0x%x %s", |
1385 | return error; | 1386 | error, gai_strerror(error)); |
1387 | return; | ||
1386 | } | 1388 | } |
1387 | strcpy(buffer, info->ai_canonname); | 1389 | snprintf(buffer, length, "%s", info->ai_canonname); |
1388 | freeaddrinfo(info); | 1390 | freeaddrinfo(info); |
1389 | return error; | ||
1390 | } | 1391 | } |
1391 | 1392 | ||
1392 | static int | 1393 | static int |
@@ -1433,7 +1434,6 @@ int main(void) | |||
1433 | int pool; | 1434 | int pool; |
1434 | char *if_name; | 1435 | char *if_name; |
1435 | struct hv_kvp_ipaddr_value *kvp_ip_val; | 1436 | struct hv_kvp_ipaddr_value *kvp_ip_val; |
1436 | char *kvp_send_buffer; | ||
1437 | char *kvp_recv_buffer; | 1437 | char *kvp_recv_buffer; |
1438 | size_t kvp_recv_buffer_len; | 1438 | size_t kvp_recv_buffer_len; |
1439 | 1439 | ||
@@ -1442,17 +1442,21 @@ int main(void) | |||
1442 | openlog("KVP", 0, LOG_USER); | 1442 | openlog("KVP", 0, LOG_USER); |
1443 | syslog(LOG_INFO, "KVP starting; pid is:%d", getpid()); | 1443 | syslog(LOG_INFO, "KVP starting; pid is:%d", getpid()); |
1444 | 1444 | ||
1445 | kvp_recv_buffer_len = NLMSG_HDRLEN + sizeof(struct cn_msg) + sizeof(struct hv_kvp_msg); | 1445 | kvp_recv_buffer_len = NLMSG_LENGTH(0) + sizeof(struct cn_msg) + sizeof(struct hv_kvp_msg); |
1446 | kvp_send_buffer = calloc(1, kvp_recv_buffer_len); | ||
1447 | kvp_recv_buffer = calloc(1, kvp_recv_buffer_len); | 1446 | kvp_recv_buffer = calloc(1, kvp_recv_buffer_len); |
1448 | if (!(kvp_send_buffer && kvp_recv_buffer)) { | 1447 | if (!kvp_recv_buffer) { |
1449 | syslog(LOG_ERR, "Failed to allocate netlink buffers"); | 1448 | syslog(LOG_ERR, "Failed to allocate netlink buffer"); |
1450 | exit(EXIT_FAILURE); | 1449 | exit(EXIT_FAILURE); |
1451 | } | 1450 | } |
1452 | /* | 1451 | /* |
1453 | * Retrieve OS release information. | 1452 | * Retrieve OS release information. |
1454 | */ | 1453 | */ |
1455 | kvp_get_os_info(); | 1454 | kvp_get_os_info(); |
1455 | /* | ||
1456 | * Cache Fully Qualified Domain Name because getaddrinfo takes an | ||
1457 | * unpredictable amount of time to finish. | ||
1458 | */ | ||
1459 | kvp_get_domain_name(full_domain_name, sizeof(full_domain_name)); | ||
1456 | 1460 | ||
1457 | if (kvp_file_init()) { | 1461 | if (kvp_file_init()) { |
1458 | syslog(LOG_ERR, "Failed to initialize the pools"); | 1462 | syslog(LOG_ERR, "Failed to initialize the pools"); |
@@ -1488,7 +1492,7 @@ int main(void) | |||
1488 | /* | 1492 | /* |
1489 | * Register ourselves with the kernel. | 1493 | * Register ourselves with the kernel. |
1490 | */ | 1494 | */ |
1491 | message = (struct cn_msg *)kvp_send_buffer; | 1495 | message = (struct cn_msg *)kvp_recv_buffer; |
1492 | message->id.idx = CN_KVP_IDX; | 1496 | message->id.idx = CN_KVP_IDX; |
1493 | message->id.val = CN_KVP_VAL; | 1497 | message->id.val = CN_KVP_VAL; |
1494 | 1498 | ||
@@ -1671,8 +1675,7 @@ int main(void) | |||
1671 | 1675 | ||
1672 | switch (hv_msg->body.kvp_enum_data.index) { | 1676 | switch (hv_msg->body.kvp_enum_data.index) { |
1673 | case FullyQualifiedDomainName: | 1677 | case FullyQualifiedDomainName: |
1674 | kvp_get_domain_name(key_value, | 1678 | strcpy(key_value, full_domain_name); |
1675 | HV_KVP_EXCHANGE_MAX_VALUE_SIZE); | ||
1676 | strcpy(key_name, "FullyQualifiedDomainName"); | 1679 | strcpy(key_name, "FullyQualifiedDomainName"); |
1677 | break; | 1680 | break; |
1678 | case IntegrationServicesVersion: | 1681 | case IntegrationServicesVersion: |
diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c index 8611962c672c..8bcb04096eb2 100644 --- a/tools/hv/hv_vss_daemon.c +++ b/tools/hv/hv_vss_daemon.c | |||
@@ -140,7 +140,6 @@ int main(void) | |||
140 | struct cn_msg *incoming_cn_msg; | 140 | struct cn_msg *incoming_cn_msg; |
141 | int op; | 141 | int op; |
142 | struct hv_vss_msg *vss_msg; | 142 | struct hv_vss_msg *vss_msg; |
143 | char *vss_send_buffer; | ||
144 | char *vss_recv_buffer; | 143 | char *vss_recv_buffer; |
145 | size_t vss_recv_buffer_len; | 144 | size_t vss_recv_buffer_len; |
146 | 145 | ||
@@ -150,10 +149,9 @@ int main(void) | |||
150 | openlog("Hyper-V VSS", 0, LOG_USER); | 149 | openlog("Hyper-V VSS", 0, LOG_USER); |
151 | syslog(LOG_INFO, "VSS starting; pid is:%d", getpid()); | 150 | syslog(LOG_INFO, "VSS starting; pid is:%d", getpid()); |
152 | 151 | ||
153 | vss_recv_buffer_len = NLMSG_HDRLEN + sizeof(struct cn_msg) + sizeof(struct hv_vss_msg); | 152 | vss_recv_buffer_len = NLMSG_LENGTH(0) + sizeof(struct cn_msg) + sizeof(struct hv_vss_msg); |
154 | vss_send_buffer = calloc(1, vss_recv_buffer_len); | ||
155 | vss_recv_buffer = calloc(1, vss_recv_buffer_len); | 153 | vss_recv_buffer = calloc(1, vss_recv_buffer_len); |
156 | if (!(vss_send_buffer && vss_recv_buffer)) { | 154 | if (!vss_recv_buffer) { |
157 | syslog(LOG_ERR, "Failed to allocate netlink buffers"); | 155 | syslog(LOG_ERR, "Failed to allocate netlink buffers"); |
158 | exit(EXIT_FAILURE); | 156 | exit(EXIT_FAILURE); |
159 | } | 157 | } |
@@ -185,7 +183,7 @@ int main(void) | |||
185 | /* | 183 | /* |
186 | * Register ourselves with the kernel. | 184 | * Register ourselves with the kernel. |
187 | */ | 185 | */ |
188 | message = (struct cn_msg *)vss_send_buffer; | 186 | message = (struct cn_msg *)vss_recv_buffer; |
189 | message->id.idx = CN_VSS_IDX; | 187 | message->id.idx = CN_VSS_IDX; |
190 | message->id.val = CN_VSS_VAL; | 188 | message->id.val = CN_VSS_VAL; |
191 | message->ack = 0; | 189 | message->ack = 0; |