Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753306AbbDGI5P (ORCPT ); Tue, 7 Apr 2015 04:57:15 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48178 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753279AbbDGI5M (ORCPT ); Tue, 7 Apr 2015 04:57:12 -0400 Date: Tue, 7 Apr 2015 10:57:08 +0200 From: Greg Kroah-Hartman To: Paul Bolle Cc: Andrew Andrianov , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Riley Andrews , Chen Gang , Fabian Frederick , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] staging: ion: Add ion-physmem driver Message-ID: <20150407085708.GB18078@kroah.com> References: <1428335363-9854-1-git-send-email-andrew@ncrmnt.org> <1428335934-10026-1-git-send-email-andrew@ncrmnt.org> <1428395745.634.168.camel@x220> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1428395745.634.168.camel@x220> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 792 Lines: 23 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/