diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2022-05-22 16:18:51 +0200 |
---|---|---|
committer | akpm <akpm@linux-foundation.org> | 2022-05-25 10:47:46 -0700 |
commit | 7fb6378701dc0d8f19c1ac4623b55f5125f0e286 (patch) | |
tree | d656a551f8fa21aff4cb33e27893cda376384cb4 /mm/shmem.c | |
parent | 02e34fff195d3a5f67cbb553795dc109a37d1dcf (diff) | |
download | linux-7fb6378701dc0d8f19c1ac4623b55f5125f0e286.tar.gz linux-7fb6378701dc0d8f19c1ac4623b55f5125f0e286.tar.bz2 linux-7fb6378701dc0d8f19c1ac4623b55f5125f0e286.zip |
cgroup: fix an error handling path in alloc_pagecache_max_30M()
If the first goto is taken, 'fd' is not opened yet (and is un-initialized).
So a direct return is safer.
Link: https://lkml.kernel.org/r/628312312eb40e0e39463a2c06415fde5295c716.1653229120.git.christophe.jaillet@wanadoo.fr
Fixes: c1a31a2f7a9c ("cgroup: fix racy check in alloc_pagecache_max_30M() helper function")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Zefan Li <lizefan.x@bytedance.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: David Vernet <void@manifault.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/shmem.c')
0 files changed, 0 insertions, 0 deletions