Merge "Check registerPassthroughServiceImplementation ret"
diff --git a/transport/include/hidl/LegacySupport.h b/transport/include/hidl/LegacySupport.h
index 18d8ba8..fab8a1d 100644
--- a/transport/include/hidl/LegacySupport.h
+++ b/transport/include/hidl/LegacySupport.h
@@ -61,7 +61,12 @@
int defaultPassthroughServiceImplementation(std::string name = "default",
size_t maxThreads = 1) {
configureRpcThreadpool(maxThreads, true);
- registerPassthroughServiceImplementation<Interface>(name);
+ status_t result = registerPassthroughServiceImplementation<Interface>(name);
+
+ if (result != OK) {
+ return result;
+ }
+
joinRpcThreadpool();
return 0;
}