mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-06 03:12:15 +02:00
Check IPC result and check isEnabled isn't NULL
This commit is contained in:
parent
dfd08e190c
commit
b0f71eae48
@ -159,7 +159,7 @@ Result pcvGetVoltageEnabled(bool *isEnabled, u32 voltage) {
|
|||||||
|
|
||||||
Result rc = serviceIpcDispatch(&g_pcvSrv);
|
Result rc = serviceIpcDispatch(&g_pcvSrv);
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc) && isEnabled) {
|
if (R_SUCCEEDED(rc)) {
|
||||||
IpcParsedCommand r;
|
IpcParsedCommand r;
|
||||||
struct {
|
struct {
|
||||||
u64 magic;
|
u64 magic;
|
||||||
@ -171,8 +171,10 @@ Result pcvGetVoltageEnabled(bool *isEnabled, u32 voltage) {
|
|||||||
resp = r.Raw;
|
resp = r.Raw;
|
||||||
|
|
||||||
rc = resp->result;
|
rc = resp->result;
|
||||||
|
if(R_SUCCEEDED(rc) && isEnabled) {
|
||||||
*isEnabled = (bool)resp->isEnabled;
|
*isEnabled = (bool)resp->isEnabled;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user