aboutsummaryrefslogtreecommitdiff
path: root/src/kms/kms_server.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-04-08 05:50:43 +0200
committerdec05eba <dec05eba@protonmail.com>2023-04-08 05:50:43 +0200
commitbe388cda5ff9e96078e39ff9c5f963e4b8fc451c (patch)
treec8cf08ca85e165206b927741c0b68201bdd6dd38 /src/kms/kms_server.c
parent8d250f7e33d568b26d2a034e10b33f0cd193268d (diff)
kms permission ok if running as root, no pkexec needed
Diffstat (limited to 'src/kms/kms_server.c')
-rw-r--r--src/kms/kms_server.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/kms/kms_server.c b/src/kms/kms_server.c
index f811050..e7ee02f 100644
--- a/src/kms/kms_server.c
+++ b/src/kms/kms_server.c
@@ -73,6 +73,7 @@ static int get_kms(const char *card_path, gsr_kms_response *response) {
if (0 != drmSetClientCap(drmfd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1)) {
response->result = KMS_RESULT_INSUFFICIENT_PERMISSIONS;
snprintf(response->data.err_msg, sizeof(response->data.err_msg), "drmSetClientCap failed, error: %s", strerror(errno));
+ close(drmfd);
return -1;
}
@@ -80,6 +81,7 @@ static int get_kms(const char *card_path, gsr_kms_response *response) {
if (!planes) {
response->result = KMS_RESULT_FAILED_TO_GET_KMS;
snprintf(response->data.err_msg, sizeof(response->data.err_msg), "failed to access planes, error: %s", strerror(errno));
+ close(drmfd);
return -1;
}
@@ -134,7 +136,7 @@ static int get_kms(const char *card_path, gsr_kms_response *response) {
}
drmModeFreePlaneResources(planes);
- close(drmfd); // TODO?
+ close(drmfd);
if(response->data.fd.fd == 0) {
response->result = KMS_RESULT_NO_KMS_AVAILABLE;