All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: xen-devel@lists.xenproject.org, alsa-devel@alsa-project.org,
	kernel-janitors@vger.kernel.org, Takashi Iwai <tiwai@suse.com>,
	Jaroslav Kysela <perex@perex.cz>
Subject: [PATCH] ALSA: xen-front: freeing an error pointer
Date: Wed, 30 May 2018 13:36:55 +0300	[thread overview]
Message-ID: <20180530103655.bnjzq2jpfrjjwvvj__3439.21992830492$1527676582$gmane$org@kili.mountain> (raw)

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>

diff --git a/sound/xen/xen_snd_front_cfg.c b/sound/xen/xen_snd_front_cfg.c
index 38c7e1eefbb9..68dcd7d1f09e 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,
 	str = xenbus_read(XBT_NIL, stream_path, XENSND_FIELD_TYPE, NULL);
 	if (IS_ERR(str)) {
 		ret = PTR_ERR(str);
+		str = NULL;
 		goto fail;
 	}
 
@@ -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);
 	if (IS_ERR(str)) {
 		ret = PTR_ERR(str);
+		str = NULL;
 		goto fail;
 	}
 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

             reply	other threads:[~2018-05-30 10:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-30 10:36 Dan Carpenter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-05-30 10:36 [PATCH] ALSA: xen-front: freeing an error pointer Dan Carpenter
2018-05-30 10:36 ` Dan Carpenter
2018-05-30 11:14 ` [Xen-devel] " Oleksandr Andrushchenko
2018-05-30 11:20   ` Takashi Iwai
2018-05-30 11:14 ` Oleksandr Andrushchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='20180530103655.bnjzq2jpfrjjwvvj__3439.21992830492$1527676582$gmane$org@kili.mountain' \
    --to=dan.carpenter@oracle.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=oleksandr_andrushchenko@epam.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.