Check IPC result and check isEnabled isn't NULL

This commit is contained in:
pixel-stuck 2018-11-18 17:08:20 -05:00 committed by GitHub
parent dfd08e190c
commit b0f71eae48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,7 +159,7 @@ Result pcvGetVoltageEnabled(bool *isEnabled, u32 voltage) {
Result rc = serviceIpcDispatch(&g_pcvSrv);
if (R_SUCCEEDED(rc) && isEnabled) {
if (R_SUCCEEDED(rc)) {
IpcParsedCommand r;
struct {
u64 magic;
@ -171,8 +171,10 @@ Result pcvGetVoltageEnabled(bool *isEnabled, u32 voltage) {
resp = r.Raw;
rc = resp->result;
if(R_SUCCEEDED(rc) && isEnabled) {
*isEnabled = (bool)resp->isEnabled;
}
}
return rc;
}