diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-01-30 12:17:02 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-01-30 12:24:47 +0000 |
commit | 5ef675159fd83ee393a86220eb4f8c514da8d0e7 (patch) | |
tree | 84bb46cfdf537281018f4b4af8e649c73c02ab8a /src/sna/sna_display.c | |
parent | 76e430e92c19ea799547e4e6ae1f389ebc6eaac5 (diff) |
sna: Handle char *backlight_iface
The backlight_iface is a freeable string, in places we were assigning a
constant string and later freeing it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_display.c')
-rw-r--r-- | src/sna/sna_display.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 0e9a07f9..22f18416 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -352,7 +352,7 @@ sna_output_backlight_init(xf86OutputPtr output) DBG(("%s: found 'wscons'\n", __FUNCTION__)); - sna_output->backlight_iface = "wscons"; + sna_output->backlight_iface = strdup("wscons"); sna_output->backlight_max = param.max; sna_output->backlight_active_level = param.curval; } @@ -471,14 +471,14 @@ has_user_backlight_override(xf86OutputPtr output) { struct sna_output *sna_output = output->driver_private; struct sna *sna = to_sna(output->scrn); - char *str; + const char *str; int max; str = xf86GetOptValString(sna->Options, OPTION_BACKLIGHT); if (str == NULL) return NULL; - sna_output->backlight_iface = str; + sna_output->backlight_iface = (char *)str; max = sna_output_backlight_get_max(output); sna_output->backlight_iface = NULL; if (max <= 0) { @@ -488,7 +488,7 @@ has_user_backlight_override(xf86OutputPtr output) return NULL; } - return str; + return strdup(str); } static char * |