lkml.org 
[lkml]   [2015]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] staging: ion: Add ion-physmem driver
On Tue, Apr 07, 2015 at 10:35:45AM +0200, Paul Bolle wrote:
> > + ipdev->heap = ion_heap_create(&ipdev->data);
> > + if (!ipdev->heap)
> > + goto errfreeipdev;
> > +
> > + if (!try_module_get(THIS_MODULE))
> > + goto errfreeheap;
>
> For built-in only code THIS_MODULE will be, basically, always NULL. So,
> I think try_module_get() will always return true.

Even if this is a module, this code is racy and broken, no module should
_ever_ call try_module_get(THIS_MODULE). That's a sign of broken code,
and/or a broken API.

thanks,

greg k-h


\
 
 \ /
  Last update: 2015-04-07 11:21    [W:0.078 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site