mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-27 14:43:58 +08:00
IB/hfi1: Fix sysfs file offset usage
Two sysfs files do not pay attention to the file offset when reading data. Fix that. Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Dean Luick <dean.luick@intel.com> Signed-off-by: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
ea0e4ce3bc
commit
4ee1585972
@ -84,7 +84,7 @@ static ssize_t read_cc_table_bin(struct file *filp, struct kobject *kobj,
|
||||
rcu_read_unlock();
|
||||
return -EINVAL;
|
||||
}
|
||||
memcpy(buf, &cc_state->cct, count);
|
||||
memcpy(buf, (void *)&cc_state->cct + pos, count);
|
||||
rcu_read_unlock();
|
||||
|
||||
return count;
|
||||
@ -131,7 +131,7 @@ static ssize_t read_cc_setting_bin(struct file *filp, struct kobject *kobj,
|
||||
rcu_read_unlock();
|
||||
return -EINVAL;
|
||||
}
|
||||
memcpy(buf, &cc_state->cong_setting, count);
|
||||
memcpy(buf, (void *)&cc_state->cong_setting + pos, count);
|
||||
rcu_read_unlock();
|
||||
|
||||
return count;
|
||||
|
Loading…
Reference in New Issue
Block a user