]> git.baikalelectronics.ru Git - kernel.git/commit
scm: fix scm_fp_list->list initialization made in wrong place
authorPavel Emelyanov <xemul@openvz.org>
Fri, 14 Nov 2008 22:51:45 +0000 (14:51 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 Nov 2008 22:51:45 +0000 (14:51 -0800)
commit5197cc32e47d017cf8bbb5ac79ac8efdc42148fa
tree99a47894d513e8726cc96b5eff26b16adfc619b9
parentd13a2aab0389a9286853fa514aa8a4167aab159c
scm: fix scm_fp_list->list initialization made in wrong place

This is the next page of the scm recursion story (the commit
1cd9859a net: Fix recursive descent in __scm_destroy()).

In function scm_fp_dup(), the INIT_LIST_HEAD(&fpl->list) of newly
created fpl is done *before* the subsequent memcpy from the old
structure and thus the freshly initialized list is overwritten.

But that's OK, since this initialization is not required at all,
since the fpl->list is list_add-ed at the destruction time in any
case (and is unused in other code), so I propose to drop both
initializations, rather than moving it after the memcpy.

Please, correct me if I miss something significant.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/scm.c