All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Waychison <mikew@google.com>
To: Matt Domsch <Matt_Domsch@dell.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>,
	lkml <linux-kernel@vger.kernel.org>,
	akpm <akpm@linux-foundation.org>,
	"matthew.e.tolentino@intel.com" <matthew.e.tolentino@intel.com>,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: Re: [PATCH] efivars: prevent oops on unload when efi is not enabled
Date: Fri, 6 May 2011 15:09:22 -0500	[thread overview]
Message-ID: <BANLkTinC10VapWniyuEE3RLgVRC6fm1EcQ@mail.gmail.com> (raw)
In-Reply-To: <20110506200456.GA18229@emperor.us.dell.com>

On Fri, May 6, 2011 at 3:04 PM, Matt Domsch <Matt_Domsch@dell.com> wrote:
> On Fri, May 06, 2011 at 02:57:02PM -0500, Randy Dunlap wrote:
>> From: Randy Dunlap <randy.dunlap@oracle.com>
>>
>> unregister_efivars() should check for efi_enabled and not undo
>> allocations when efi is not enabled.  Otherwise there is an Oops
>> during module unload:
>
> Thanks Randy.
>
> I'm not sure why the driver is still loaded at all if efi_enabled==0.
>
> static int __init
> efivars_init(void)
> {
> ...
>        if (!efi_enabled)
>                return 0;
>
>
>
> That return 0 should be return -ENODEV I think.  Mike?

Ya, I changed efivars so that others could still use the
register_efivars/unregister_efivars interfaces when !efi_enabled.
They are used by the drivers/firmware/google/gsmi.c driver currently
pending in linux-next.

I think the right approach in this case would be to do

        if (efi_enabled) {
               unregister_efivars(&__efivars);
               kobject_put(efi_kobj);
        }

in efivars_exit().

>
> Thanks,
> Matt
>
> --
> Matt Domsch
> Technology Strategist
> Dell | Office of the CTO
>

  parent reply	other threads:[~2011-05-06 20:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-06 19:57 [PATCH] efivars: prevent oops on unload when efi is not enabled Randy Dunlap
     [not found] ` <20110506200456.GA18229@emperor.us.dell.com>
2011-05-06 20:09   ` Mike Waychison [this message]
2011-05-06 20:23 ` [PATCH v2] " Mike Waychison
2011-05-06 20:27 ` [PATCH v3] " Mike Waychison
2011-05-06 21:30   ` Randy Dunlap

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=BANLkTinC10VapWniyuEE3RLgVRC6fm1EcQ@mail.gmail.com \
    --to=mikew@google.com \
    --cc=Matt_Domsch@dell.com \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.e.tolentino@intel.com \
    --cc=randy.dunlap@oracle.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.