nvChannelClose: cleanup fixes

This commit is contained in:
fincs 2020-04-19 22:15:32 +02:00
parent dc20bf67e9
commit f5e4615a40
No known key found for this signature in database
GPG Key ID: 62C7609ADA219C60

View File

@ -14,7 +14,6 @@ Result nvChannelCreate(NvChannel* c, const char* dev)
c->has_init = true;
rc = nvOpen(&c->fd, dev);
if (R_FAILED(rc))
c->fd = -1;
@ -32,10 +31,12 @@ void nvChannelClose(NvChannel* c)
if (!c->has_init)
return;
if (c->fd != -1)
if (c->fd != -1) {
nvClose(c->fd);
c->fd = -1;
}
c->fd = -1;
c->has_init = false;
}
Result nvChannelSetPriority(NvChannel* c, NvChannelPriority prio) {