Skip to content

Commit

Permalink
Binder bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
plutoo committed Feb 19, 2018
1 parent cde0706 commit 6ee4d38
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions nx/source/gfx/binder.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ Result binderInitSession(Binder *session, u32 unk0)
rc = binderAdjustRefcount(session, 1, 1);

if (R_FAILED(rc)) {
rc = binderAdjustRefcount(session, -1, 0);
binderAdjustRefcount(session, -1, 0);
return rc;
}

rc = binderGetNativeHandle(session, unk0, &session->nativeHandle);

if (R_FAILED(rc)) {
rc = binderAdjustRefcount(session, -1, 1);
rc = binderAdjustRefcount(session, -1, 0);
binderAdjustRefcount(session, -1, 1);
binderAdjustRefcount(session, -1, 0);
return rc;
}

// When the output nativeHandle is 0 the Binder ID is probably invalid.
if(session->nativeHandle == 0) {
rc = binderAdjustRefcount(session, -1, 1);
rc = binderAdjustRefcount(session, -1, 0);
if (session->nativeHandle == 0) {
binderAdjustRefcount(session, -1, 1);
binderAdjustRefcount(session, -1, 0);
return MAKERESULT(Module_Libnx, LibnxError_BadInput);
}

Expand Down

0 comments on commit 6ee4d38

Please sign in to comment.