[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160615203753.GA30666@swift.blarg.de>
Date: Wed, 15 Jun 2016 22:37:53 +0200
From: Max Kellermann <max@...mpel.org>
To: Shuah Khan <shuahkh@....samsung.com>
Cc: linux-media@...r.kernel.org, mchehab@....samsung.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] drivers/media/media-device: fix double free bug in
_unregister()
On 2016/06/15 22:32, Shuah Khan <shuahkh@....samsung.com> wrote:
> This change introduces memory leaks, since drivers are relying on
> media_device_unregister() to free interfaces.
This is what I thought, too, until I checked the code paths. Who adds
entries to that list? Only media_gobj_create() does, and only when
type==MEDIA_GRAPH_INTF_DEVNODE. That is called via
media_interface_init(), via media_devnode_create().
In the whole kernel, there are two calls to media_devnode_create():
one in dvbdev.c and another one in v4l2-dev.c. Both callers take care
for freeing their interface. Both would crash if somebody else would
free it for them before they get a chance to do it. Which is the very
thing my patch addresses.
Did I miss something?
Max
Powered by blists - more mailing lists