From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57869) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMsaa-0004Uk-2J for qemu-devel@nongnu.org; Thu, 28 Aug 2014 01:49:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMsaT-00011q-Uf for qemu-devel@nongnu.org; Thu, 28 Aug 2014 01:49:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64702) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMsaT-00011a-NX for qemu-devel@nongnu.org; Thu, 28 Aug 2014 01:49:33 -0400 Date: Thu, 28 Aug 2014 13:49:43 +0800 From: Fam Zheng Message-ID: <20140828054943.GA4572@T430.redhat.com> References: <1409199158-23453-1-git-send-email-famz@redhat.com> <1409199158-23453-2-git-send-email-famz@redhat.com> <20140828044805.GB26019@irqsave.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20140828044805.GB26019@irqsave.net> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 1/3] nfs: Fix leak of opts in nfs_file_open List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?Beno=EEt?= Canet Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi On Thu, 08/28 06:48, Beno=EEt Canet wrote: > The Thursday 28 Aug 2014 =E0 12:12:36 (+0800), Fam Zheng wrote : > > Signed-off-by: Fam Zheng > > --- > > block/nfs.c | 8 ++++++-- > > 1 file changed, 6 insertions(+), 2 deletions(-) > >=20 > > diff --git a/block/nfs.c b/block/nfs.c > > index 93d87f3..8740c1a 100644 > > --- a/block/nfs.c > > +++ b/block/nfs.c > > @@ -393,15 +393,19 @@ static int nfs_file_open(BlockDriverState *bs, = QDict *options, int flags, > > qemu_opts_absorb_qdict(opts, options, &local_err); > > if (local_err) { > > error_propagate(errp, local_err); > > - return -EINVAL; > > + ret =3D -EINVAL; > > + goto out; > > } > > ret =3D nfs_client_open(client, qemu_opt_get(opts, "filename"), > > (flags & BDRV_O_RDWR) ? O_RDWR : O_RDONLY, > > errp); > > if (ret < 0) { > > - return ret; > > + goto out; > > } > > bs->total_sectors =3D ret; > > + ret =3D 0; > > +out: > > + qemu_opts_del(opts); >=20 > > return 0; >=20 > Hmm ... "return ret;" ? ;) >=20 Oops, patches that are not right in the first try always tend to fail aga= in :) Fam