All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: linux-wireless@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Bug in BCMA: device_unregister causing "NULL pointer dereference at"
Date: Thu, 21 Jul 2011 12:33:41 -0400	[thread overview]
Message-ID: <4E2854E5.3020905@gnu.org> (raw)
In-Reply-To: <CACna6rwPqeW5Bhc7A0FnkCaRq-a-nA4ziUQdoiakN_DvMyL_RQ@mail.gmail.com>

On 07/21/2011 03:18 AM, Rafał Miłecki wrote:

>> So when I unload bcma after I got driver (b43) for 0x812 core, I get
>> NULL pointer dereference.
>>
>> Any tip, why does it happen?
>
> I've tracked where does crash really happen (kobject_del does not
> really say much). The real forwardtrace is:
> device_unregister → device_del → kobject_del → kobj_kset_leave →
> kobj_kset_leave → list_del_init
>
> If you take a look at list_del_init, it touches "prev" and "next". So
> I've added some debugging:
> pr_info("core->dev.kobj.entry.prev: 0x%p\n", core->dev.kobj.entry.prev);
> pr_info("core->dev.kobj.entry.next: 0x%p\n", core->dev.kobj.entry.next);

There are options for debugging that you may want to enable:

CONFIG_DEBUG_LIST
CONFIG_DEBUG_OBJECTS
CONFIG_DEBUG_KOBJECT

Actually, consider enabling most debug options as possible, except 
perhaps the most time consuming (such as CONFIG_DEBUG_KMEMLEAK).  Maybe 
you are passing a freed pointer or something.

Print the pointers you are passing to device_register() and 
device_unregister().

> [  612.819320] bcma: core->dev.kobj.entry.prev: 0x  (null)

You may want to make it a macro and print it in most bcma functions.

-- 
Regards,
Pavel Roskin

      reply	other threads:[~2011-07-21 16:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-07 15:25 Bug in BCMA: device_unregister causing "NULL pointer dereference at" Rafał Miłecki
2011-07-07 15:27 ` Rafał Miłecki
2011-07-14 14:45 ` Francois Romieu
2011-07-21  7:14   ` Rafał Miłecki
2011-07-21  7:18 ` Rafał Miłecki
2011-07-21 16:33   ` Pavel Roskin [this message]

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=4E2854E5.3020905@gnu.org \
    --to=proski@gnu.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=zajec5@gmail.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.