From: Janne Grunau <j@jannau.net>
To: Julia Lawall <julia@diku.dk>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 3/8] drivers/media/video/hdpvr: introduce missing kfree
Date: Wed, 16 Sep 2009 11:13:26 +0000 [thread overview]
Message-ID: <20090916111325.GA14900@aniel.lan> (raw)
In-Reply-To: <Pine.LNX.4.64.0909111821180.10552@pc-004.diku.dk>
On Fri, Sep 11, 2009 at 06:21:35PM +0200, Julia Lawall wrote:
>
> Error handling code following a kzalloc should free the allocated data.
Thanks for the report. I'll commit a different patch which adds the buffer
to the buffer list as soon it is allocated. The hdpvr_free_buffers() in the
error handling code will clean it up then. See below:
diff --git a/linux/drivers/media/video/hdpvr/hdpvr-video.c b/linux/drivers/media/video/hdpvr/hdpvr-video.c
--- a/linux/drivers/media/video/hdpvr/hdpvr-video.c
+++ b/linux/drivers/media/video/hdpvr/hdpvr-video.c
@@ -134,6 +134,8 @@
v4l2_err(&dev->v4l2_dev, "cannot allocate buffer\n");
goto exit;
}
+ list_add_tail(&buf->buff_list, &dev->free_buff_list);
+
buf->dev = dev;
urb = usb_alloc_urb(0, GFP_KERNEL);
@@ -158,7 +160,6 @@
hdpvr_read_bulk_callback, buf);
buf->status = BUFSTAT_AVAILABLE;
- list_add_tail(&buf->buff_list, &dev->free_buff_list);
}
return 0;
exit:
WARNING: multiple messages have this Message-ID (diff)
From: Janne Grunau <j@jannau.net>
To: Julia Lawall <julia@diku.dk>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 3/8] drivers/media/video/hdpvr: introduce missing kfree
Date: Wed, 16 Sep 2009 13:13:26 +0200 [thread overview]
Message-ID: <20090916111325.GA14900@aniel.lan> (raw)
In-Reply-To: <Pine.LNX.4.64.0909111821180.10552@pc-004.diku.dk>
On Fri, Sep 11, 2009 at 06:21:35PM +0200, Julia Lawall wrote:
>
> Error handling code following a kzalloc should free the allocated data.
Thanks for the report. I'll commit a different patch which adds the buffer
to the buffer list as soon it is allocated. The hdpvr_free_buffers() in the
error handling code will clean it up then. See below:
diff --git a/linux/drivers/media/video/hdpvr/hdpvr-video.c b/linux/drivers/media/video/hdpvr/hdpvr-video.c
--- a/linux/drivers/media/video/hdpvr/hdpvr-video.c
+++ b/linux/drivers/media/video/hdpvr/hdpvr-video.c
@@ -134,6 +134,8 @@
v4l2_err(&dev->v4l2_dev, "cannot allocate buffer\n");
goto exit;
}
+ list_add_tail(&buf->buff_list, &dev->free_buff_list);
+
buf->dev = dev;
urb = usb_alloc_urb(0, GFP_KERNEL);
@@ -158,7 +160,6 @@
hdpvr_read_bulk_callback, buf);
buf->status = BUFSTAT_AVAILABLE;
- list_add_tail(&buf->buff_list, &dev->free_buff_list);
}
return 0;
exit:
next prev parent reply other threads:[~2009-09-16 11:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-11 16:21 [PATCH 3/8] drivers/media/video/hdpvr: introduce missing kfree Julia Lawall
2009-09-11 16:21 ` Julia Lawall
2009-09-16 11:13 ` Janne Grunau [this message]
2009-09-16 11:13 ` Janne Grunau
2010-02-02 15:19 ` Mauro Carvalho Chehab
2010-02-02 15:19 ` Mauro Carvalho Chehab
2010-02-03 14:12 ` Janne Grunau
2010-02-03 14:12 ` Janne Grunau
2010-02-03 14:28 ` Mauro Carvalho Chehab
2010-02-03 14:28 ` Mauro Carvalho Chehab
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=20090916111325.GA14900@aniel.lan \
--to=j@jannau.net \
--cc=julia@diku.dk \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.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.