net/bnxt: fix overrun of ULP device params array
authorKishore Padmanabha <kishore.padmanabha@broadcom.com>
Thu, 30 Apr 2020 21:42:12 +0000 (17:42 -0400)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 11 May 2020 20:27:39 +0000 (22:27 +0200)
Fix a buffer overrun issue spotted by coverity while accessing
the array ulp_device_params.
Note that the issue was observed in an internal Coverity scan.

Fixes: 313ac35ac701 ("net/bnxt: support ULP session manager init")

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/tf_ulp/ulp_template_db.c

index 8638416..e89aefa 100644 (file)
@@ -321,7 +321,7 @@ struct bnxt_ulp_def_ident_info ulp_def_ident_tbl[] = {
        }
 };
 
-struct bnxt_ulp_device_params ulp_device_params[] = {
+struct bnxt_ulp_device_params ulp_device_params[BNXT_ULP_DEVICE_ID_LAST] = {
        [BNXT_ULP_DEVICE_ID_WH_PLUS] = {
                .global_fid_enable       = BNXT_ULP_SYM_YES,
                .byte_order              = (enum bnxt_ulp_byte_order)