From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 055571C15DF for ; Wed, 1 Jul 2015 09:10:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 0039F9541A for ; Wed, 1 Jul 2015 09:10:59 +0000 (UTC) Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nVThmPq2Vi3O for ; Wed, 1 Jul 2015 09:10:58 +0000 (UTC) Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by hemlock.osuosl.org (Postfix) with ESMTPS id 0A30595418 for ; Wed, 1 Jul 2015 09:10:58 +0000 (UTC) Received: by pdbep18 with SMTP id ep18so22522576pdb.1 for ; Wed, 01 Jul 2015 02:10:57 -0700 (PDT) Date: Wed, 1 Jul 2015 14:40:48 +0530 From: Sudip Mukherjee Subject: Re: [PATCH] staging: unisys: add visorhid driver Message-ID: <20150701091048.GA16731@sudip-PC> References: <1435240731-18502-1-git-send-email-benjamin.romer@unisys.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1435240731-18502-1-git-send-email-benjamin.romer@unisys.com> List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: Benjamin Romer Cc: gregkh@linuxfoundation.org, sparmaintainer@unisys.com, driverdev-devel@linuxdriverproject.org, Jes.Sorensen@redhat.com On Thu, Jun 25, 2015 at 09:58:51AM -0400, Benjamin Romer wrote: > From: Erik Arfvidson > > +static int > +visorhid_init(void) > +{ > + int rc = 0; > + > + spin_lock_init(&devnopool_lock); > + dev_no_pool = kzalloc(BITS_TO_LONGS(MAXDEVICES), GFP_KERNEL); > + if (!dev_no_pool) { > + rc = -ENOMEM; > + goto cleanups; > + } > + visorbus_register_visor_driver(&visorhid_driver); > +cleanups: > + if (rc < 0) > + visorhid_cleanup_guts(); This will be true only if kzalloc fails. And if kzalloc fails then the visorhid_driver is still not registered. But in the cleanups you are calling visorhid_cleanup_guts() which will try to unregister the driver and that should generate a warning by driver_unregister as we are trying to unregister a driver which is not yet registerd. regards sudip _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel