ATH10K Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [ath6kl:pending 46/46] drivers/net/wireless/ath/ath10k/pci.c:3687 ath10k_pci_remove() warn: variable dereferenced before check 'ar' (see line 3685)
@ 2018-10-25  5:52 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2018-10-25  5:52 UTC (permalink / raw)
  To: kbuild, Venkateswara Naralasetty; +Cc: Kalle Valo, Kan Yan, kbuild-all, ath10k

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-10-25  5:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-25  5:52 [ath6kl:pending 46/46] drivers/net/wireless/ath/ath10k/pci.c:3687 ath10k_pci_remove() warn: variable dereferenced before check 'ar' (see line 3685) Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox