diff options
| author | Alex Shi <alex.shi@linaro.org> | 2016-09-20 15:18:54 +0800 |
|---|---|---|
| committer | Alex Shi <alex.shi@linaro.org> | 2016-09-20 15:18:54 +0800 |
| commit | 5f87c475f82a75e10bc6e249b7471349f1ef1636 (patch) | |
| tree | df697b570c923c722b5ba24f502c6abdbb5e05f1 /fs/sysfs/file.c | |
| parent | d3a1d035ef89cfb89cf6e2128d44b95771f2c7b4 (diff) | |
| parent | d2d693d1ba7d93ec7c5db8aca2da29a4c91f6782 (diff) | |
Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android
Conflicts:
in fs/proc/task_mmu.c:
looks like vma_get_anon_name() want have a name for anonymous
vma when there is no name used in vma. commit: 586278d78bf
The name show is after any other names, so it maybe covered.
but anyway, it just a show here.
Diffstat (limited to 'fs/sysfs/file.c')
| -rw-r--r-- | fs/sysfs/file.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index f35523d4fa3a..b803213d1307 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -114,9 +114,15 @@ static ssize_t sysfs_kf_read(struct kernfs_open_file *of, char *buf, * If buf != of->prealloc_buf, we don't know how * large it is, so cannot safely pass it to ->show */ - if (pos || WARN_ON_ONCE(buf != of->prealloc_buf)) + if (WARN_ON_ONCE(buf != of->prealloc_buf)) return 0; len = ops->show(kobj, of->kn->priv, buf); + if (pos) { + if (len <= pos) + return 0; + len -= pos; + memmove(buf, buf + pos, len); + } return min(count, len); } |
