From: Dean Luick Date: Tue, 12 Apr 2016 17:49:58 +0000 (-0700) Subject: IB/hfi1: Fix sysfs file offset usage X-Git-Tag: v4.14-rc1~3104^2~35^2~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4ee1585972c0772a5126d7242a906b18acee7b0f;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Dean Luick Signed-off-by: Jubin John Signed-off-by: Doug Ledford --- diff --git a/drivers/staging/rdma/hfi1/sysfs.c b/drivers/staging/rdma/hfi1/sysfs.c index c7f1271..8cd6df8 100644 --- a/drivers/staging/rdma/hfi1/sysfs.c +++ b/drivers/staging/rdma/hfi1/sysfs.c @@ -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;