From: Abd-Alrhman Masalkhi <abd.masalkhi@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org
Subject: A field in files_struct has been used without initialization
Date: Thu, 6 Oct 2022 12:44:39 +0200 [thread overview]
Message-ID: <20221006104439.46235-1-abd.masalkhi@gmail.com> (raw)
Hello Linux community,
I have came acrose the following code in dup_fd()
1 newf = kmem_cache_alloc(files_cachep, GFP_KERNEL);
2 if (!newf)
3 goto out;
4
5 atomic_set(&newf->count, 1);
6
7 spin_lock_init(&newf->file_lock);
8 newf->resize_in_progress = false;
9 init_waitqueue_head(&newf->resize_wait);
10 newf->next_fd = 0;
11 new_fdt = &newf->fdtab;
12 new_fdt->max_fds = NR_OPEN_DEFAULT;
13 new_fdt->close_on_exec = newf->close_on_exec_init;
On line 13 new_fdt->close_on_exec has given the value of
newf->close_on_exec_init, but new_fdt->close_on_exec itself has not
been initialized, is it intended to be like this.
Thanky you very much!
next reply other threads:[~2022-10-06 10:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-06 10:44 Abd-Alrhman Masalkhi [this message]
2022-10-06 10:57 ` A field in files_struct has been used without initialization Abd-Alrhman Masalkhi
2022-10-07 19:16 ` Al Viro
2022-10-09 9:33 ` Abd-Alrhman Masalkhi
2022-10-09 18:21 ` Al Viro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221006104439.46235-1-abd.masalkhi@gmail.com \
--to=abd.masalkhi@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).