From: Amit Kumar Salecha Date: Mon, 29 Mar 2010 02:43:44 +0000 (+0000) Subject: netxen: fix fw load from file X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e270299a2f7a3040fe598113f74c2a7d5f63b582;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git netxen: fix fw load from file Rarely: Fw file size can be unaligned to 8. Signed-off-by: Amit Kumar Salecha Signed-off-by: David S. Miller --- diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 141bc4389fec..439f3e859693 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c @@ -1019,6 +1019,16 @@ netxen_load_firmware(struct netxen_adapter *adapter) flashaddr += 8; } + + size = (__force u32)nx_get_fw_size(adapter) % 8; + if (size) { + data = cpu_to_le64(ptr64[i]); + + if (adapter->pci_mem_write(adapter, + flashaddr, data)) + return -EIO; + } + } else { u64 data; u32 hi, lo;