From: Kulikov Vasiliy <segooon@gmail.com>
To: Dan Carpenter <error27@gmail.com>,
kernel-janitors@vger.kernel.org,
Adaptec OEM Raid Solutions <aacraid@adaptec.com>,
"James E.J. Bottomley" <James.Bottomley@suse.de>Julia Lawall <j>
Subject: Re: [PATCH] scsi: dpt_i2o: fix memory leak
Date: Wed, 14 Jul 2010 19:05:38 +0000 [thread overview]
Message-ID: <20100714190538.GA4616@albatros> (raw)
In-Reply-To: <20100714185831.GA5164@bicker>
On Wed, Jul 14, 2010 at 20:58 +0200, Dan Carpenter wrote:
> On Wed, Jul 14, 2010 at 09:53:27PM +0400, Kulikov Vasiliy wrote:
> > Free allocated memory if adpt_ioctl_to_context() failed.
> >
> > Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
> > ---
> > drivers/scsi/dpt_i2o.c | 4 +++-
> > 1 files changed, 3 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
> > index f2d4df1..dd9a43b 100644
> > --- a/drivers/scsi/dpt_i2o.c
> > +++ b/drivers/scsi/dpt_i2o.c
> > @@ -1839,8 +1839,10 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *arg)
> > sg_offset = (msg[0]>>4)&0xf;
> > msg[2] = 0x40000000; // IOCTL context
> > msg[3] = adpt_ioctl_to_context(pHba, reply);
>
> This patch is wrong I'm afraid. adpt_ioctl_to_context() frees "reply" if
> there is an error.
Hmm right, but it is very strange coding style - function frees resources
that it did not allocated on error and does not free them on success.
Please, ignore this patch. Sorry for the noise.
WARNING: multiple messages have this Message-ID (diff)
From: Kulikov Vasiliy <segooon@gmail.com>
To: Dan Carpenter <error27@gmail.com>,
kernel-janitors@vger.kernel.org,
Adaptec OEM Raid Solutions <aacraid@adaptec.com>,
"James E.J. Bottomley" <James.Bottomley@suse.de>Julia Lawall <j>
Subject: Re: [PATCH] scsi: dpt_i2o: fix memory leak
Date: Wed, 14 Jul 2010 23:05:38 +0400 [thread overview]
Message-ID: <20100714190538.GA4616@albatros> (raw)
In-Reply-To: <20100714185831.GA5164@bicker>
On Wed, Jul 14, 2010 at 20:58 +0200, Dan Carpenter wrote:
> On Wed, Jul 14, 2010 at 09:53:27PM +0400, Kulikov Vasiliy wrote:
> > Free allocated memory if adpt_ioctl_to_context() failed.
> >
> > Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
> > ---
> > drivers/scsi/dpt_i2o.c | 4 +++-
> > 1 files changed, 3 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
> > index f2d4df1..dd9a43b 100644
> > --- a/drivers/scsi/dpt_i2o.c
> > +++ b/drivers/scsi/dpt_i2o.c
> > @@ -1839,8 +1839,10 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *arg)
> > sg_offset = (msg[0]>>4)&0xf;
> > msg[2] = 0x40000000; // IOCTL context
> > msg[3] = adpt_ioctl_to_context(pHba, reply);
>
> This patch is wrong I'm afraid. adpt_ioctl_to_context() frees "reply" if
> there is an error.
Hmm right, but it is very strange coding style - function frees resources
that it did not allocated on error and does not free them on success.
Please, ignore this patch. Sorry for the noise.
WARNING: multiple messages have this Message-ID (diff)
From: Kulikov Vasiliy <segooon@gmail.com>
To: Dan Carpenter <error27@gmail.com>,
kernel-janitors@vger.kernel.org,
Adaptec OEM Raid Solutions <aacraid@adaptec.com>,
"James E.J. Bottomley" <James.Bottomley@suse.de>,
Julia Lawall <julia@diku.dk>,
Frederic Weisbecker <fweisbec@gmail.com>,
John Kacur <jkacur@redhat.com>,
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: dpt_i2o: fix memory leak
Date: Wed, 14 Jul 2010 23:05:38 +0400 [thread overview]
Message-ID: <20100714190538.GA4616@albatros> (raw)
In-Reply-To: <20100714185831.GA5164@bicker>
On Wed, Jul 14, 2010 at 20:58 +0200, Dan Carpenter wrote:
> On Wed, Jul 14, 2010 at 09:53:27PM +0400, Kulikov Vasiliy wrote:
> > Free allocated memory if adpt_ioctl_to_context() failed.
> >
> > Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
> > ---
> > drivers/scsi/dpt_i2o.c | 4 +++-
> > 1 files changed, 3 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
> > index f2d4df1..dd9a43b 100644
> > --- a/drivers/scsi/dpt_i2o.c
> > +++ b/drivers/scsi/dpt_i2o.c
> > @@ -1839,8 +1839,10 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *arg)
> > sg_offset = (msg[0]>>4)&0xf;
> > msg[2] = 0x40000000; // IOCTL context
> > msg[3] = adpt_ioctl_to_context(pHba, reply);
>
> This patch is wrong I'm afraid. adpt_ioctl_to_context() frees "reply" if
> there is an error.
Hmm right, but it is very strange coding style - function frees resources
that it did not allocated on error and does not free them on success.
Please, ignore this patch. Sorry for the noise.
next prev parent reply other threads:[~2010-07-14 19:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-14 17:53 [PATCH] scsi: dpt_i2o: fix memory leak Kulikov Vasiliy
2010-07-14 17:53 ` Kulikov Vasiliy
2010-07-14 18:58 ` Dan Carpenter
2010-07-14 18:58 ` Dan Carpenter
2010-07-14 19:05 ` Kulikov Vasiliy [this message]
2010-07-14 19:05 ` Kulikov Vasiliy
2010-07-14 19:05 ` Kulikov Vasiliy
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=20100714190538.GA4616@albatros \
--to=segooon@gmail.com \
--cc=James.Bottomley@suse.de \
--cc=aacraid@adaptec.com \
--cc=error27@gmail.com \
--cc=kernel-janitors@vger.kernel.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.