Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent adea72f commit c3efeaaCopy full SHA for c3efeaa
fs/namei.c
@@ -222,9 +222,10 @@ getname_kernel(const char * filename)
222
if (len <= EMBEDDED_NAME_MAX) {
223
result->name = (char *)result->iname;
224
} else if (len <= PATH_MAX) {
225
+ const size_t size = offsetof(struct filename, iname[1]);
226
struct filename *tmp;
227
- tmp = kmalloc(sizeof(*tmp), GFP_KERNEL);
228
+ tmp = kmalloc(size, GFP_KERNEL);
229
if (unlikely(!tmp)) {
230
__putname(result);
231
return ERR_PTR(-ENOMEM);
0 commit comments