From: Amit Kumar Salecha Date: Thu, 1 Apr 2010 19:01:28 +0000 (+0000) Subject: qlcnic: fix fw load from file X-Git-Tag: MMI-PSA29.97-13-9~23873^2~611 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0bc92b5b4987ab55f2b75ef42251476b2e049e3d;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git qlcnic: 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/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c index 7c34e4e29b3f..0a424e038cff 100644 --- a/drivers/net/qlcnic/qlcnic_init.c +++ b/drivers/net/qlcnic/qlcnic_init.c @@ -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;