lkml.org 
[lkml]   [2019]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5.2 10/20] media: radio-raremono: change devm_k*alloc to k*alloc
Hi there, 

On Fri, Aug 02, 2019 at 03:04:25AM -0700, Joe Perches wrote:
> On Fri, 2019-08-02 at 11:40 +0200, Greg Kroah-Hartman wrote:
> > From: Luke Nowakowski-Krijger <lnowakow@eng.ucsd.edu>
> >
> > commit c666355e60ddb4748ead3bdd983e3f7f2224aaf0 upstream.
> >
> > Change devm_k*alloc to k*alloc to manually allocate memory
> >
> > The manual allocation and freeing of memory is necessary because when
> > the USB radio is disconnected, the memory associated with devm_k*alloc
> > is freed. Meaning if we still have unresolved references to the radio
> > device, then we get use-after-free errors.
> >
> > This patch fixes this by manually allocating memory, and freeing it in
> > the v4l2.release callback that gets called when the last radio device
> > exits.
>
> This really should be commented in the code
> and not just in the commit changelog as some
> unsuspecting person will likely undo this in
> the future without one.

You reckon I should submit a patch with the necessary parts commented?

Thanks,
- Luke

\
 
 \ /
  Last update: 2019-08-06 07:35    [W:0.054 / U:19.808 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site