We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d6bcc21 commit 960534aCopy full SHA for 960534a
fs/namei.c
@@ -221,9 +221,10 @@ getname_kernel(const char * filename)
221
if (len <= EMBEDDED_NAME_MAX) {
222
result->name = (char *)result->iname;
223
} else if (len <= PATH_MAX) {
224
+ const size_t size = offsetof(struct filename, iname[1]);
225
struct filename *tmp;
226
- tmp = kmalloc(sizeof(*tmp), GFP_KERNEL);
227
+ tmp = kmalloc(size, GFP_KERNEL);
228
if (unlikely(!tmp)) {
229
__putname(result);
230
return ERR_PTR(-ENOMEM);
0 commit comments