Thread (1 message) 1 message, 1 author, 2015-07-21

Re: [PATCH 1/1] ath10k: fixing wrong initialization of struct channel

From: Kalle Valo <hidden>
Date: 2015-07-21 15:56:15
Also in: linux-wireless, lkml

Possibly related (same subject, not in this thread)

Maninder Singh [off-list ref] writes:
quoted
quoted
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 <redacted>
quoted
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 [off-list ref]
    Signed-off-by: Kalle Valo [off-list ref]


-- 
Kalle Valo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help