Messages in this thread | | | Date | Tue, 7 Apr 2015 10:57:08 +0200 | From | Greg Kroah-Hartman <> | Subject | Re: [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
| |