lkml.org 
[lkml]   [2018]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/5] media: sunxi: Add A10 CSI driver
On Thu, Nov 15, 2018 at 09:51:06PM +0100, Maxime Ripard wrote:
> Hi Hans,
>
> Thanks for your review! I'll address the other comments you made.
>
> On Tue, Nov 13, 2018 at 01:24:47PM +0100, Hans Verkuil wrote:
> > > +static int csi_probe(struct platform_device *pdev)
> > > +{
> > > + struct sun4i_csi *csi;
> > > + struct resource *res;
> > > + int ret;
> > > + int irq;
> > > +
> > > + csi = devm_kzalloc(&pdev->dev, sizeof(*csi), GFP_KERNEL);
> >
> > devm_kzalloc is not recommended: all devm_ memory is freed when the driver
> > is unbound, but a filehandle might still have a reference open.
>
> How would a !devm variant with a kfree in the remove help? We would
> still fall in the same case, right?

Not quite. For video nodes this is handled: the release callback gets called
once there are no file handles open to the device. That may well be much
later than the device has been unbound from the driver.

--
Sakari Ailus
sakari.ailus@linux.intel.com

\
 
 \ /
  Last update: 2018-11-21 23:02    [W:0.067 / U:0.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site