]> git.baikalelectronics.ru Git - kernel.git/commit
ath10k: don't assume this is a PCI dev in generic code
authorBrian Norris <briannorris@chromium.org>
Fri, 2 Nov 2018 17:17:48 +0000 (10:17 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 6 Nov 2018 16:22:50 +0000 (18:22 +0200)
commit7e06409e8f884881113e92763edf4c3db9b768ac
treead7b817826ea2405cdc2d138e65b7c3e2e7417f9
parentbde3b37e6d848414153fc5c85f94b1c249d54da4
ath10k: don't assume this is a PCI dev in generic code

Not all devices using this driver are backed by a PCI device, so it's
not fair to assume 'to_pci_dev()' is valid. Fortunately, we only were
using this to convert straight back to a bare 'device', which means we
were only doing no-op pointer arithmetic, and not actually accessing
potentially out-of-bounds memory. But this is still bad practice.

Just use 'ar->dev' directly, since that's really all we're looking for.

Fixes: 7d3f6fbe8848 ("ath10k: add platform regulatory domain support")
Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath10k/mac.c