Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9942c546 authored by MarcKe's avatar MarcKe
Browse files

healthd: remove useless goto in charger mode

jumping to the cleanup makes a check that will fail anyways,
since fd is smaller than 0

Change-Id: Ic53f186e00fc09a49de5185b01a2bf64a8ceba35
parent d1bec30d
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -229,7 +229,7 @@ static int set_tricolor_led(int on, int color)
            fd = open(leds[i].path, O_RDWR);
            if (fd < 0) {
                LOGE("Could not open red led node\n");
                goto cleanup;
                continue;
            }
            if (on)
                snprintf(buffer, sizeof(int), "%d\n", 255);
@@ -238,7 +238,6 @@ static int set_tricolor_led(int on, int color)

            if (write(fd, buffer, strlen(buffer)) < 0)
                LOGE("Could not write to led node\n");
cleanup:
            if (fd >= 0)
                close(fd);
        }