summaryrefslogtreecommitdiff
path: root/usb
diff options
context:
space:
mode:
Diffstat (limited to 'usb')
-rw-r--r--usb/gadget/1.1/default/UsbGadget.cpp2
-rw-r--r--usb/gadget/1.2/default/UsbGadget.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/usb/gadget/1.1/default/UsbGadget.cpp b/usb/gadget/1.1/default/UsbGadget.cpp
index 36d865dc2e..0d0b4032d4 100644
--- a/usb/gadget/1.1/default/UsbGadget.cpp
+++ b/usb/gadget/1.1/default/UsbGadget.cpp
@@ -46,6 +46,8 @@ void currentFunctionsAppliedCallback(bool functionsApplied, void* payload) {
}
Return<void> UsbGadget::getCurrentUsbFunctions(const sp<V1_0::IUsbGadgetCallback>& callback) {
+ if (!callback) return Void();
+
Return<void> ret = callback->getCurrentUsbFunctionsCb(
mCurrentUsbFunctions, mCurrentUsbFunctionsApplied ? Status::FUNCTIONS_APPLIED
: Status::FUNCTIONS_NOT_APPLIED);
diff --git a/usb/gadget/1.2/default/UsbGadget.cpp b/usb/gadget/1.2/default/UsbGadget.cpp
index 8dd229e0fd..a59e983f69 100644
--- a/usb/gadget/1.2/default/UsbGadget.cpp
+++ b/usb/gadget/1.2/default/UsbGadget.cpp
@@ -46,6 +46,8 @@ void currentFunctionsAppliedCallback(bool functionsApplied, void* payload) {
}
Return<void> UsbGadget::getCurrentUsbFunctions(const sp<V1_0::IUsbGadgetCallback>& callback) {
+ if (!callback) return Void();
+
Return<void> ret = callback->getCurrentUsbFunctionsCb(
mCurrentUsbFunctions, mCurrentUsbFunctionsApplied ? Status::FUNCTIONS_APPLIED
: Status::FUNCTIONS_NOT_APPLIED);