From: Takashi Iwai Subject: Re: [PATCH] coverity fix in alsa-libs Date: Thu, 18 Sep 2014 12:24:54 +0200 Message-ID: References: <96.53.05230.A729A145@epcpsbgx3.samsung.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 504302651A9 for ; Thu, 18 Sep 2014 12:24:55 +0200 (CEST) In-Reply-To: <96.53.05230.A729A145@epcpsbgx3.samsung.com> <23134993.91951411027577842.JavaMail.weblogic@epv6ml12> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: renu.tyagi@samsung.com Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Thu, 18 Sep 2014 08:06:18 +0000 (GMT), Renu Tyagi wrote: > > Hi, > I have done the cosmetic changes. > I dont trust my mailers editor so I am attaching it as well :) Unfortunately your untrusted mailer didn't serve as wished. The patch itself looks good. Could you post the whole series? thanks, Takashi > > Thanks > Renu Tyagi > ----------------------------------------- > From 66bbcc5e532c24876bd2fa2bc9d86609679e1062 Mon Sep 17 00:00:00 2001 > From: renu tyagi > Date: Thu, 18 Sep 2014 13:23:51 +0530 > Subject: [PATCH] rawmidi : Handle h to be closed in case of error before returning > > > Signed-off-by: renu tyagi > --- > src/rawmidi/rawmidi.c | 5 ++++- > 1 files changed, 4 insertions(+), 1 deletions(-) > > diff --git a/src/rawmidi/rawmidi.c b/src/rawmidi/rawmidi.c > index b835b47..ac699b4 100644 > --- a/src/rawmidi/rawmidi.c > +++ b/src/rawmidi/rawmidi.c > @@ -256,8 +256,11 @@ static int snd_rawmidi_open_conf(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp > snd_config_delete(type_conf); > if (err >= 0) > err = open_func(inputp, outputp, name, rawmidi_root, rawmidi_conf, mode); > - if (err < 0) > + if (err < 0) { > + if (h) > + snd_dlclose(h); > return err; > + } > if (inputp) { > (*inputp)->dl_handle = h; h = NULL; > snd_rawmidi_params_default(*inputp, ¶ms); > -- > 1.7.1