ATH10K Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@01.org, Venkateswara Naralasetty <vnaralas@codeaurora.org>
Cc: Kalle Valo <kvalo@codeaurora.org>, Kan Yan <kyan@chromium.org>,
	kbuild-all@01.org, ath10k@lists.infradead.org
Subject: [ath6kl:pending 46/46] drivers/net/wireless/ath/ath10k/pci.c:3687 ath10k_pci_remove() warn: variable dereferenced before check 'ar' (see line 3685)
Date: Thu, 25 Oct 2018 08:52:23 +0300	[thread overview]
Message-ID: <20181025055223.da5sp7b2jayezmrb@mwanda> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git pending
head:   9fb5f44c1dff6c461f0ceaf3e6665cedc99cc1b4
commit: 9fb5f44c1dff6c461f0ceaf3e6665cedc99cc1b4 [46/46] ath10k: Add wrapper function to ath10k debug

smatch warnings:
drivers/net/wireless/ath/ath10k/pci.c:3687 ath10k_pci_remove() warn: variable dereferenced before check 'ar' (see line 3685)

# https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?id=9fb5f44c1dff6c461f0ceaf3e6665cedc99cc1b4
git remote add ath6kl https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
git remote update ath6kl
git checkout 9fb5f44c1dff6c461f0ceaf3e6665cedc99cc1b4
vim +/ar +3687 drivers/net/wireless/ath/ath10k/pci.c

5e3dd157 Kalle Valo    2013-06-12  3679  
5e3dd157 Kalle Valo    2013-06-12  3680  static void ath10k_pci_remove(struct pci_dev *pdev)
5e3dd157 Kalle Valo    2013-06-12  3681  {
5e3dd157 Kalle Valo    2013-06-12  3682  	struct ath10k *ar = pci_get_drvdata(pdev);
5e3dd157 Kalle Valo    2013-06-12  3683  	struct ath10k_pci *ar_pci;
5e3dd157 Kalle Valo    2013-06-12  3684  
7aa7a72a Michal Kazior 2014-08-25 @3685  	ath10k_dbg(ar, ATH10K_DBG_PCI, "pci remove\n");
                                                           ^^
The ath10k_dbg() function dereferences "ar".

5e3dd157 Kalle Valo    2013-06-12  3686  
5e3dd157 Kalle Valo    2013-06-12 @3687  	if (!ar)
                                                    ^^^
Too late.

5e3dd157 Kalle Valo    2013-06-12  3688  		return;
5e3dd157 Kalle Valo    2013-06-12  3689  
5e3dd157 Kalle Valo    2013-06-12  3690  	ar_pci = ath10k_pci_priv(ar);
5e3dd157 Kalle Valo    2013-06-12  3691  
5e3dd157 Kalle Valo    2013-06-12  3692  	if (!ar_pci)
5e3dd157 Kalle Valo    2013-06-12  3693  		return;
5e3dd157 Kalle Valo    2013-06-12  3694  
5e3dd157 Kalle Valo    2013-06-12  3695  	ath10k_core_unregister(ar);
5c771e74 Michal Kazior 2014-08-22  3696  	ath10k_pci_free_irq(ar);
403d627b Michal Kazior 2014-08-22  3697  	ath10k_pci_deinit_irq(ar);
90188f80 Raja Mani     2016-01-27  3698  	ath10k_pci_release_resource(ar);
77258d40 Michal Kazior 2015-05-18  3699  	ath10k_pci_sleep_sync(ar);
2986e3ef Michal Kazior 2014-08-07  3700  	ath10k_pci_release(ar);
5e3dd157 Kalle Valo    2013-06-12  3701  	ath10k_core_destroy(ar);
5e3dd157 Kalle Valo    2013-06-12  3702  }
5e3dd157 Kalle Valo    2013-06-12  3703  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

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

                 reply	other threads:[~2018-10-25  5:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20181025055223.da5sp7b2jayezmrb@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=ath10k@lists.infradead.org \
    --cc=kbuild-all@01.org \
    --cc=kbuild@01.org \
    --cc=kvalo@codeaurora.org \
    --cc=kyan@chromium.org \
    --cc=vnaralas@codeaurora.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox