All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: ath10k@lists.infradead.org
Subject: Re: [PATCH] ath10k:  Fix un-initialized debug objects.
Date: Fri, 25 Oct 2013 21:35:10 -0700	[thread overview]
Message-ID: <526B467E.1060607@candelatech.com> (raw)
In-Reply-To: <877gd0fzti.fsf@kamboji.qca.qualcomm.com>

On 10/25/2013 08:58 PM, Kalle Valo wrote:
> Ben Greear <greearb@candelatech.com> writes:
>
>> On 10/25/2013 12:49 AM, Kalle Valo wrote:
>>> greearb@candelatech.com writes:
>>
>>>>    	INIT_WORK(&ar->restart_work, ath10k_core_restart);
>>>>
>>>> +	ath10k_debug_init(ar);
>>>
>>> For symmetry would it make more sense to move ath10k_debug_destroy() to
>>> ath10k_core_unregister()? That way we could avoid adding a new function.
>>>
>>
>> In my opinion, you should initialize such things as early as possible
>> so you don't have to worry so much about the various error cases leaving
>> things un-initialized.  I believe my patch accomplished that.
>
> Well, I again like symmetry and simplicity.
>
>> What new function are you planning to avoid?
>
> I would prefer not to create ath10k_debug_init().
>
> What I was trying to suggest is this, I think it should fix the bug you
> are seeing:

I don't think so.  The problem is that the init logic can fail before
the debug logic is ever initialized, so any cleanup that attempts to
access the debug logic can blow up.

All my patch does is ensure the debug related members are always initialized,
and so can be cleaned up later without problem.

Maybe your patch fixes something else though, I haven't investigated that
part of the code in detail yet.

Thanks,
Ben


>
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -738,8 +738,6 @@ EXPORT_SYMBOL(ath10k_core_create);
>
>   void ath10k_core_destroy(struct ath10k *ar)
>   {
> -       ath10k_debug_destroy(ar);
> -
>          flush_workqueue(ar->workqueue);
>          destroy_workqueue(ar->workqueue);
>
> @@ -986,6 +984,8 @@ void ath10k_core_unregister(struct ath10k *ar)
>          ath10k_mac_unregister(ar);
>
>          ath10k_core_free_firmware_files(ar);
> +
> +       ath10k_debug_destroy(ar);
>   }
>   EXPORT_SYMBOL(ath10k_core_unregister);
>


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

  reply	other threads:[~2013-10-26  4:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24 18:26 [PATCH] ath10k: Fix un-initialized debug objects greearb
2013-10-25  7:49 ` Kalle Valo
2013-10-25 14:59   ` Ben Greear
2013-10-26  3:58     ` Kalle Valo
2013-10-26  4:35       ` Ben Greear [this message]
2013-10-28 10:10         ` Kalle Valo
2013-10-28 16:43           ` Ben Greear
  -- strict thread matches above, loose matches on Subject: below --
2013-11-04 17:18 greearb
2013-11-08  9:44 ` Kalle Valo

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=526B467E.1060607@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=ath10k@lists.infradead.org \
    --cc=kvalo@qca.qualcomm.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.