backlight: Remove unnecessary and confusing NULL checks

At this point path must point to an allocated string since otherwise the
asprintf that makes the allocation would have failed and we would have
returned earlier.
This commit is contained in:
Rob Bradford 2012-12-05 18:47:06 +00:00 committed by Kristian Høgsberg
parent 26e009cd9c
commit 0b0be8eaf7
1 changed files with 2 additions and 4 deletions

View File

@ -69,8 +69,7 @@ static long backlight_get(struct backlight *backlight, char *node)
ret = value;
out:
close(fd);
if (path)
free(path);
free(path);
return ret;
}
@ -127,8 +126,7 @@ long backlight_set_brightness(struct backlight *backlight, long brightness)
out:
if (buffer)
free(buffer);
if (path)
free(path);
free(path);
close(fd);
return ret;
}