diff options
author | Rob Bradford <rob@linux.intel.com> | 2012-12-05 18:47:06 +0000 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-12-11 23:47:17 -0500 |
commit | b27094f1b2d57f66e9053b764e3c74c57a28ee62 (patch) | |
tree | 0a7c45c6cd317320553d1161f8a9c50d0436d13d | |
parent | f14a241f3554963e8bef82beae275301720ac47e (diff) | |
download | weston-b27094f1b2d57f66e9053b764e3c74c57a28ee62.tar.gz |
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.
-rw-r--r-- | src/libbacklight.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libbacklight.c b/src/libbacklight.c index df811b41..2ac135a5 100644 --- a/src/libbacklight.c +++ b/src/libbacklight.c @@ -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; } |