linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* A field in files_struct has been used without initialization
@ 2022-10-06 10:44 Abd-Alrhman Masalkhi
  2022-10-06 10:57 ` Abd-Alrhman Masalkhi
  0 siblings, 1 reply; 5+ messages in thread
From: Abd-Alrhman Masalkhi @ 2022-10-06 10:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-fsdevel

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!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-09 18:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-06 10:44 A field in files_struct has been used without initialization Abd-Alrhman Masalkhi
2022-10-06 10:57 ` 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

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).