Commit e46dcbb1 authored by Dan Carpenter's avatar Dan Carpenter Committed by Takashi Iwai

ALSA: xen-front: freeing an error pointer

kfree() doesn't accept error pointers so I've set "str" to NULL on these
paths.

Fixes: fd3b3604 ("ALSA: xen-front: Read sound driver configuration from Xen store")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarOleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 986376b6
...@@ -306,6 +306,7 @@ static int cfg_get_stream_type(const char *path, int index, ...@@ -306,6 +306,7 @@ static int cfg_get_stream_type(const char *path, int index,
str = xenbus_read(XBT_NIL, stream_path, XENSND_FIELD_TYPE, NULL); str = xenbus_read(XBT_NIL, stream_path, XENSND_FIELD_TYPE, NULL);
if (IS_ERR(str)) { if (IS_ERR(str)) {
ret = PTR_ERR(str); ret = PTR_ERR(str);
str = NULL;
goto fail; goto fail;
} }
...@@ -347,6 +348,7 @@ static int cfg_stream(struct xen_snd_front_info *front_info, ...@@ -347,6 +348,7 @@ static int cfg_stream(struct xen_snd_front_info *front_info,
str = xenbus_read(XBT_NIL, stream_path, XENSND_FIELD_TYPE, NULL); str = xenbus_read(XBT_NIL, stream_path, XENSND_FIELD_TYPE, NULL);
if (IS_ERR(str)) { if (IS_ERR(str)) {
ret = PTR_ERR(str); ret = PTR_ERR(str);
str = NULL;
goto fail; goto fail;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment