liquidio: update module parameter fw_type to reflect firmware type loaded
authorRick Farrington <ricardo.farrington@cavium.com>
Sat, 23 Sep 2017 00:12:51 +0000 (17:12 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Sep 2017 03:25:40 +0000 (20:25 -0700)
Signed-off-by: Rick Farrington <ricardo.farrington@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/liquidio/lio_main.c

index a3c9867c0340480669b0bcdef2801e6b8450e378..963803bc6633024aa49da1d5e17c9e1bfa7785ee 100644 (file)
@@ -1934,10 +1934,12 @@ static int load_firmware(struct octeon_device *oct)
        char fw_name[LIO_MAX_FW_FILENAME_LEN];
        char *tmp_fw_type;
 
-       if (fw_type_is_auto())
+       if (fw_type_is_auto()) {
                tmp_fw_type = LIO_FW_NAME_TYPE_NIC;
-       else
+               strncpy(fw_type, tmp_fw_type, sizeof(fw_type));
+       } else {
                tmp_fw_type = fw_type;
+       }
 
        sprintf(fw_name, "%s%s%s_%s%s", LIO_FW_DIR, LIO_FW_BASE_NAME,
                octeon_get_conf(oct)->card_name, tmp_fw_type,