mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 17:27:01 +00:00
[as5916-54xks] Revise the sfp eeprom read length
This commit is contained in:
@@ -1342,10 +1342,14 @@ static ssize_t sfp_eeprom_read(loff_t off, char *buf, size_t count, int port)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
status = length; /* Read length */
|
||||
/* Calculate return length */
|
||||
if (count < length) {
|
||||
length = count;
|
||||
}
|
||||
|
||||
memcpy(buf, data->ipmi_resp.eeprom + (off % IPMI_READ_MAX_LEN), length);
|
||||
data->ipmi_resp.eeprom_valid = 1;
|
||||
return length;
|
||||
|
||||
exit:
|
||||
return status;
|
||||
|
||||
Reference in New Issue
Block a user