lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 16 Sep 2009 13:13:26 +0200
From:	Janne Grunau <j@...nau.net>
To:	Julia Lawall <julia@...u.dk>
Cc:	Mauro Carvalho Chehab <mchehab@...radead.org>,
	linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
	kernel-janitors@...r.kernel.org
Subject: Re: [PATCH 3/8] drivers/media/video/hdpvr: introduce missing kfree

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:
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ