]> git.baikalelectronics.ru Git - kernel.git/commit
net/sock: add WARN_ON(parent->sk) in sock_graft()
authorSowmini Varadhan <sowmini.varadhan@oracle.com>
Thu, 6 Jul 2017 15:15:07 +0000 (08:15 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 8 Jul 2017 10:16:16 +0000 (11:16 +0100)
commite7594dc7ac040540a55e732e9a5dac8753dc6321
tree606445d216e1fb481b1d6e8d5f1fb264d41fa4f9
parent324d61ed8456f1463306fe58ab6c9ed3795de3bb
net/sock: add WARN_ON(parent->sk) in sock_graft()

sock_graft() unilaterally sets up parent->sk based on the
assumption that the existing parent->sk is null. If this
condition is not true, then the existing parent->sk would
be leaked, so add a WARN_ON() to alert callers who may fall
in this category.

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sock.h