staging: r8188eu: Fix smatch warnings in odm_HWConfig.c
authorLarry Finger <Larry.Finger@lwfinger.net>
Wed, 4 Sep 2013 20:56:06 +0000 (15:56 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Sep 2013 14:47:45 +0000 (07:47 -0700)
Smatch reports the following warnings:
drivers/staging/rtl8188eu/hal/odm_HWConfig.c:302 odm_RxPhyStatus92CSeries_Parsing() error: buffer overflow 'pPhyInfo->RxPwr' 2 <= 2
drivers/staging/rtl8188eu/hal/odm_HWConfig.c:319 odm_RxPhyStatus92CSeries_Parsing() error: buffer overflow 'pPhyInfo->RxMIMOSignalStrength' 2 <= 2
drivers/staging/rtl8188eu/hal/odm_HWConfig.c:322 odm_RxPhyStatus92CSeries_Parsing() error: buffer overflow 'pPhyStaRpt->path_rxsnr' 2 <= 2
drivers/staging/rtl8188eu/hal/odm_HWConfig.c:322 odm_RxPhyStatus92CSeries_Parsing() error: buffer overflow 'pPhyInfo->RxSNR' 2 <= 2
drivers/staging/rtl8188eu/hal/odm_HWConfig.c:323 odm_RxPhyStatus92CSeries_Parsing() error: buffer overflow 'pPhyStaRpt->path_rxsnr' 2 <= 2
drivers/staging/rtl8188eu/hal/odm_HWConfig.c:323 odm_RxPhyStatus92CSeries_Parsing() error: buffer overflow 'dm_odm->PhyDbgInfo.RxSNRdB' 2 <= 2

These warnings are again due to the number of radio patchs being increased
to 3 without adjustments to the array sizes.

A duplicate and redundant definition was also removed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/include/odm.h
drivers/staging/rtl8188eu/include/odm_HWConfig.h
drivers/staging/rtl8188eu/include/rtw_recv.h

index e3b40f8..300ca78 100644 (file)
@@ -283,8 +283,6 @@ struct odm_rate_adapt {
 
 /*  Declare for common info */
 
-#define MAX_PATH_NUM_92CS      2
-
 struct odm_phy_status_info {
        u8      RxPWDBAll;
        u8      SignalQuality;   /*  in 0-100 index. */
index 63779f5..df52722 100644 (file)
@@ -69,7 +69,7 @@ struct phy_rx_agc_info {
 };
 
 struct phy_status_rpt {
-       struct phy_rx_agc_info path_agc[2];
+       struct phy_rx_agc_info path_agc[3];
        u8      ch_corr[2];
        u8      cck_sig_qual_ofdm_pwdb_all;
        u8      cck_agc_rpt_ofdm_cfosho_a;
@@ -79,7 +79,7 @@ struct phy_status_rpt {
        u8      path_cfotail[2];
        u8      pcts_mask[2];
        s8      stream_rxevm[2];
-       u8      path_rxsnr[2];
+       u8      path_rxsnr[3];
        u8      noise_power_db_lsb;
        u8      rsvd_2[3];
        u8      stream_csi[2];
index bae8885..be9c30c 100644 (file)
@@ -83,7 +83,7 @@ struct signal_stat {
        u32     total_num;              /* num of valid elements */
        u32     total_val;              /* sum of valid elements */
 };
-#define MAX_PATH_NUM_92CS              2
+#define MAX_PATH_NUM_92CS              3
 struct phy_info {
        u8      RxPWDBAll;
        u8      SignalQuality;   /*  in 0-100 index. */