* [PATCH 1/1] ath10k: fixing wrong initialization of struct channel
@ 2015-07-16 3:55 Maninder Singh
2015-07-21 11:54 ` Kalle Valo
2015-07-24 7:48 ` Kalle Valo
0 siblings, 2 replies; 5+ messages in thread
From: Maninder Singh @ 2015-07-16 3:55 UTC (permalink / raw)
To: kvalo, ath10k, linux-wireless, netdev, linux-kernel
Cc: pankaj.m, Maninder Singh
chandef is initialized with NULL and on the very next line,
we are using it to get channel, which is not correct.
channel should be initialized after obtaining chandef.
Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
---
drivers/net/wireless/ath/ath10k/mac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 218b6af..3d196b5 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -836,7 +836,7 @@ static inline int ath10k_vdev_setup_sync(struct ath10k *ar)
static int ath10k_monitor_vdev_start(struct ath10k *ar, int vdev_id)
{
struct cfg80211_chan_def *chandef = NULL;
- struct ieee80211_channel *channel = chandef->chan;
+ struct ieee80211_channel *channel = NULL;
struct wmi_vdev_start_request_arg arg = {};
int ret = 0;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] ath10k: fixing wrong initialization of struct channel
2015-07-16 3:55 Maninder Singh
@ 2015-07-21 11:54 ` Kalle Valo
2015-07-24 7:48 ` Kalle Valo
1 sibling, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2015-07-21 11:54 UTC (permalink / raw)
To: Maninder Singh; +Cc: ath10k, linux-wireless, netdev, linux-kernel, pankaj.m
Maninder Singh <maninder1.s@samsung.com> writes:
> chandef is initialized with NULL and on the very next line,
> we are using it to get channel, which is not correct.
>
> channel should be initialized after obtaining chandef.
>
> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
How did you find this bug?
--
Kalle Valo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] ath10k: fixing wrong initialization of struct channel
@ 2015-07-21 11:59 Maninder Singh
2015-07-21 15:56 ` Kalle Valo
0 siblings, 1 reply; 5+ messages in thread
From: Maninder Singh @ 2015-07-21 11:59 UTC (permalink / raw)
To: Kalle Valo
Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
PANKAJ MISHRA
Pj4gY2hhbmRlZiBpcyBpbml0aWFsaXplZCB3aXRoIE5VTEwgYW5kIG9uIHRoZSB2ZXJ5IG5leHQg
bGluZSwNCj4+IHdlIGFyZSB1c2luZyBpdCB0byBnZXQgY2hhbm5lbCwgd2hpY2ggaXMgbm90IGNv
cnJlY3QuDQo+Pg0KPj4gY2hhbm5lbCBzaG91bGQgYmUgaW5pdGlhbGl6ZWQgYWZ0ZXIgb2J0YWlu
aW5nIGNoYW5kZWYuDQo+Pg0KPj4gU2lnbmVkLW9mZi1ieTogTWFuaW5kZXIgU2luZ2ggPG1hbmlu
ZGVyMS5zQHNhbXN1bmcuY29tPg0KDQo+SG93IGRpZCB5b3UgZmluZCB0aGlzIGJ1Zz8NCg0KU3Rh
dGljIGFubHlzaXMgcmVwb3J0cyB0aGlzIGJ1ZyBsaWtlIGNvdmVyaXR5IG9yIGFueSBvdGhlciBz
dGF0aWMgdG9vbCBsaWtlIGNwcGNoZWNrIDotDQoNCmRyaXZlcnMvbmV0L3dpcmVsZXNzL2F0aC9h
dGgxMGsvbWFjLmM6ODM5XTogKGVycm9yKSBQb3NzaWJsZSBudWxsIHBvaW50ZXIgZGVyZWZlcmVu
Y2U6IGNoYW5kZWYNCg0KVGhhbmtzLA0KTWFuaW5kZXI=
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] ath10k: fixing wrong initialization of struct channel
2015-07-21 11:59 [PATCH 1/1] ath10k: fixing wrong initialization of struct channel Maninder Singh
@ 2015-07-21 15:56 ` Kalle Valo
0 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2015-07-21 15:56 UTC (permalink / raw)
To: maninder1.s
Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
PANKAJ MISHRA
Maninder Singh <maninder1.s@samsung.com> writes:
>>> chandef is initialized with NULL and on the very next line,
>>> we are using it to get channel, which is not correct.
>>>
>>> channel should be initialized after obtaining chandef.
>>>
>>> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
>
>>How did you find this bug?
>
> Static anlysis reports this bug like coverity or any other static tool like cppcheck :-
>
> drivers/net/wireless/ath/ath10k/mac.c:839]: (error) Possible null pointer dereference: chandef
Thanks. This is always good to add to the commit log so I did that:
ath10k: fix wrong initialization of struct channel
chandef is initialized with NULL and on the very next line, we are using it to
get channel, which is not correct. Channel should be initialized after
obtaining chandef.
Found by cppcheck:
ath/ath10k/mac.c:839]: (error) Possible null pointer dereference: chandef
Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
--
Kalle Valo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] ath10k: fixing wrong initialization of struct channel
2015-07-16 3:55 Maninder Singh
2015-07-21 11:54 ` Kalle Valo
@ 2015-07-24 7:48 ` Kalle Valo
1 sibling, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2015-07-24 7:48 UTC (permalink / raw)
To: Maninder Singh; +Cc: ath10k, linux-wireless, netdev, linux-kernel, pankaj.m
Maninder Singh <maninder1.s@samsung.com> writes:
> chandef is initialized with NULL and on the very next line,
> we are using it to get channel, which is not correct.
>
> channel should be initialized after obtaining chandef.
>
> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Thanks, applied.
--
Kalle Valo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-07-24 7:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-21 11:59 [PATCH 1/1] ath10k: fixing wrong initialization of struct channel Maninder Singh
2015-07-21 15:56 ` Kalle Valo
-- strict thread matches above, loose matches on Subject: below --
2015-07-16 3:55 Maninder Singh
2015-07-21 11:54 ` Kalle Valo
2015-07-24 7:48 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).