diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-05-30 06:36:55 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-05-30 07:19:45 -0400 |
commit | e46dcbb17d790008a12b1c18f6235d03d1dd635b (patch) | |
tree | 9913ccd2a12efa83332f225656cd6d9235152a5c | |
parent | 986376b68dcc95bb7df60ad30c2353c1f7578fa5 (diff) |
ALSA: xen-front: freeing an error pointer
kfree() doesn't accept error pointers so I've set "str" to NULL on these
paths.
Fixes: fd3b36045c2c ("ALSA: xen-front: Read sound driver configuration from Xen store")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/xen/xen_snd_front_cfg.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/xen/xen_snd_front_cfg.c b/sound/xen/xen_snd_front_cfg.c index 684b5f1d51ac..eda077c8087a 100644 --- a/sound/xen/xen_snd_front_cfg.c +++ b/sound/xen/xen_snd_front_cfg.c | |||
@@ -306,6 +306,7 @@ static int cfg_get_stream_type(const char *path, int index, | |||
306 | str = xenbus_read(XBT_NIL, stream_path, XENSND_FIELD_TYPE, NULL); | 306 | str = xenbus_read(XBT_NIL, stream_path, XENSND_FIELD_TYPE, NULL); |
307 | if (IS_ERR(str)) { | 307 | if (IS_ERR(str)) { |
308 | ret = PTR_ERR(str); | 308 | ret = PTR_ERR(str); |
309 | str = NULL; | ||
309 | goto fail; | 310 | goto fail; |
310 | } | 311 | } |
311 | 312 | ||
@@ -347,6 +348,7 @@ static int cfg_stream(struct xen_snd_front_info *front_info, | |||
347 | str = xenbus_read(XBT_NIL, stream_path, XENSND_FIELD_TYPE, NULL); | 348 | str = xenbus_read(XBT_NIL, stream_path, XENSND_FIELD_TYPE, NULL); |
348 | if (IS_ERR(str)) { | 349 | if (IS_ERR(str)) { |
349 | ret = PTR_ERR(str); | 350 | ret = PTR_ERR(str); |
351 | str = NULL; | ||
350 | goto fail; | 352 | goto fail; |
351 | } | 353 | } |
352 | 354 | ||