]> git.baikalelectronics.ru Git - kernel.git/commit
ath9k: check pdata variable before dereferencing it
authorGabor Juhos <juhosg@openwrt.org>
Mon, 10 Dec 2012 23:06:41 +0000 (00:06 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 11 Dec 2012 21:00:39 +0000 (16:00 -0500)
commit40e8b6cc76e0446775ca88e9cc8870d7b4a1abbb
tree86ced1f36f85b684186c9f1ef78eb4cf11eef0cd
parentf0a67d7f439b09764c2e0f24647b78c1399bd25c
ath9k: check pdata variable before dereferencing it

Due to my recent commit (ath9k: allow to load EEPROM
content via firmware API) smatch complains about that
the 'pdata' variable in 'ath9k_hw_init' can be NULL
and it is dereferenced before checking that. That is
absolutely correct.

Check the 'pdata' variable before using it to avoid
a NULL pointer dereference.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/init.c