qlcnic: fix fw load from file
authorAmit Kumar Salecha <amit.salecha@qlogic.com>
Thu, 1 Apr 2010 19:01:28 +0000 (19:01 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 3 Apr 2010 21:19:12 +0000 (14:19 -0700)
Rarely: Fw file size can be unaligned to 8.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/qlcnic/qlcnic_init.c

index 7c34e4e29b3f79e64d2e3ac8f926c7dc0b48b57e..0a424e038cff97c3fc738945493ed3ef5baba330 100644 (file)
@@ -949,6 +949,16 @@ qlcnic_load_firmware(struct qlcnic_adapter *adapter)
 
                        flashaddr += 8;
                }
+
+               size = (__force u32)qlcnic_get_fw_size(adapter) % 8;
+               if (size) {
+                       data = cpu_to_le64(ptr64[i]);
+
+                       if (qlcnic_pci_mem_write_2M(adapter,
+                                               flashaddr, data))
+                               return -EIO;
+               }
+
        } else {
                u64 data;
                u32 hi, lo;