All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Benjamin Romer <benjamin.romer@unisys.com>
Cc: gregkh@linuxfoundation.org, sparmaintainer@unisys.com,
	driverdev-devel@linuxdriverproject.org, Jes.Sorensen@redhat.com
Subject: Re: [PATCH] staging: unisys: add visorhid driver
Date: Wed, 1 Jul 2015 14:40:48 +0530	[thread overview]
Message-ID: <20150701091048.GA16731@sudip-PC> (raw)
In-Reply-To: <1435240731-18502-1-git-send-email-benjamin.romer@unisys.com>

On Thu, Jun 25, 2015 at 09:58:51AM -0400, Benjamin Romer wrote:
> From: Erik Arfvidson <erik.arfvidson@unisys.com>
> 
<snip>
> +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

  reply	other threads:[~2015-07-01  9:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25 13:58 [PATCH] staging: unisys: add visorhid driver Benjamin Romer
2015-07-01  9:10 ` Sudip Mukherjee [this message]
2015-07-15  1:48 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150701091048.GA16731@sudip-PC \
    --to=sudipm.mukherjee@gmail.com \
    --cc=Jes.Sorensen@redhat.com \
    --cc=benjamin.romer@unisys.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=sparmaintainer@unisys.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.