From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-wg0-f43.google.com ([74.125.82.43]:53153 "EHLO mail-wg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752127AbbBLANQ (ORCPT ); Wed, 11 Feb 2015 19:13:16 -0500 Received: by mail-wg0-f43.google.com with SMTP id n12so6843738wgh.2 for ; Wed, 11 Feb 2015 16:13:15 -0800 (PST) Date: Thu, 12 Feb 2015 00:13:13 +0000 From: Luis de Bethencourt To: Antti Palosaari Cc: Matthias Schwarzott , Christian Engelmayer , linux-media@vger.kernel.org, mchehab@osg.samsung.com, hans.verkuil@cisco.com Subject: Re: [PATCH] [media] si2165: Fix possible leak in si2165_upload_firmware() Message-ID: <20150212001313.GB1864@turing> References: <1423688303-31894-1-git-send-email-cengelma@gmx.at> <54DBCD5D.8000409@gentoo.org> <20150211233856.GA5444@turing> <54DBE8F5.6080803@iki.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54DBE8F5.6080803@iki.fi> Sender: linux-media-owner@vger.kernel.org List-ID: On Thu, Feb 12, 2015 at 01:42:45AM +0200, Antti Palosaari wrote: > On 02/12/2015 01:38 AM, Luis de Bethencourt wrote: > >On Wed, Feb 11, 2015 at 10:45:01PM +0100, Matthias Schwarzott wrote: > >>On 11.02.2015 21:58, Christian Engelmayer wrote: > >>>In case of an error function si2165_upload_firmware() releases the already > >>>requested firmware in the exit path. However, there is one deviation where > >>>the function directly returns. Use the correct cleanup so that the firmware > >>>memory gets freed correctly. Detected by Coverity CID 1269120. > >>> > >>>Signed-off-by: Christian Engelmayer > >>>--- > >>>Compile tested only. Applies against linux-next. > >>>--- > >>> drivers/media/dvb-frontends/si2165.c | 2 +- > >>> 1 file changed, 1 insertion(+), 1 deletion(-) > >>> > >>>diff --git a/drivers/media/dvb-frontends/si2165.c b/drivers/media/dvb-frontends/si2165.c > >>>index 98ddb49ad52b..4cc5d10ed0d4 100644 > >>>--- a/drivers/media/dvb-frontends/si2165.c > >>>+++ b/drivers/media/dvb-frontends/si2165.c > >>>@@ -505,7 +505,7 @@ static int si2165_upload_firmware(struct si2165_state *state) > >>> /* reset crc */ > >>> ret = si2165_writereg8(state, 0x0379, 0x01); > >>> if (ret) > >>>- return ret; > >>>+ goto error; > >>> > >>> ret = si2165_upload_firmware_block(state, data, len, > >>> &offset, block_count); > >>> > >>Good catch. > >> > >>Signed-off-by: Matthias Schwarzott > >> > > > >Good catch indeed. > > > >Can I sign off? Not sure what the rules are. > > > >Signed-off-by: Luis de Bethencourt > > > You cannot sign it unless patch is going through hands. Probably you want > review it. Check documentation "SubmittingPatches". > > https://www.kernel.org/doc/Documentation/SubmittingPatches > > regards > Antti > > -- > http://palosaari.fi/ > -- Hi Antti, That was an interesting read. Now I know how these tags work :) Thanks for the pointing it out to me. So I meant "Reviewed-by:" Luis