public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* static analysis issue in rtl8188de driver
@ 2019-05-04 21:50 Colin Ian King
  2019-05-06  7:56 ` Pkshih
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2019-05-04 21:50 UTC (permalink / raw)
  To: Ping-Ke Shih, Kalle Valo, Larry Finger, linux-wireless
  Cc: linux-kernel@vger.kernel.org

Hi,

Static analysis with Coverity has found an issue in the rtl8188de
wireless driver in drivers/net/wireless/realtek/rtlwifi/rtl8192de/dm.c
in function tl92d_dm_txpower_tracking_callback_thermalmeter.

The issue is that u8 array ofdm_index[3] is never initialized, however
it is decremented and incremented in two places resulting in garbage
value from the stack being updated in the following code:

	if (thermalvalue > rtlpriv->dm.thermalvalue) {
        	for (i = 0; i < rf; i++)
                	ofdm_index[i] -= delta;
        	cck_index -= delta;
	} else {
        	for (i = 0; i < rf; i++)
                	ofdm_index[i] += index;
        	cck_index += index;	
	}

At my first look at the code I believe ofdm_index should be just
zero-initialized at declaration time, but I suspect that I'm overlooking
something maybe a bit deeper. Any ideas?

Colin


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-06  7:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-04 21:50 static analysis issue in rtl8188de driver Colin Ian King
2019-05-06  7:56 ` Pkshih

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