Quellcode durchsuchen

qlcnic: Fix corruption while copying

Use proper typecasting while performing byte-by-byte copy

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Shahed Shaikh vor 10 Jahren
Ursprung
Commit
15f1bb1f1e
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c

+ 1 - 1
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c

@@ -1415,7 +1415,7 @@ static int qlcnic_83xx_copy_fw_file(struct qlcnic_adapter *adapter)
 	if (fw->size & 0xF) {
 		addr = dest + size;
 		for (i = 0; i < (fw->size & 0xF); i++)
-			data[i] = temp[size + i];
+			data[i] = ((u8 *)temp)[size + i];
 		for (; i < 16; i++)
 			data[i] = 0;
 		ret = qlcnic_ms_mem_write128(adapter, addr,