提交 4ee15859 编写于 作者: D Dean Luick 提交者: Doug Ledford

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: NDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: NDean Luick <dean.luick@intel.com>
Signed-off-by: NJubin John <jubin.john@intel.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 ea0e4ce3
...@@ -84,7 +84,7 @@ static ssize_t read_cc_table_bin(struct file *filp, struct kobject *kobj, ...@@ -84,7 +84,7 @@ static ssize_t read_cc_table_bin(struct file *filp, struct kobject *kobj,
rcu_read_unlock(); rcu_read_unlock();
return -EINVAL; return -EINVAL;
} }
memcpy(buf, &cc_state->cct, count); memcpy(buf, (void *)&cc_state->cct + pos, count);
rcu_read_unlock(); rcu_read_unlock();
return count; return count;
...@@ -131,7 +131,7 @@ static ssize_t read_cc_setting_bin(struct file *filp, struct kobject *kobj, ...@@ -131,7 +131,7 @@ static ssize_t read_cc_setting_bin(struct file *filp, struct kobject *kobj,
rcu_read_unlock(); rcu_read_unlock();
return -EINVAL; return -EINVAL;
} }
memcpy(buf, &cc_state->cong_setting, count); memcpy(buf, (void *)&cc_state->cong_setting + pos, count);
rcu_read_unlock(); rcu_read_unlock();
return count; return count;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册