]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: eliminate case of writing to freed memory
authorJon Paul Maloy <jon.maloy@ericsson.com>
Thu, 26 Jun 2014 01:41:30 +0000 (20:41 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Jun 2014 19:50:54 +0000 (12:50 -0700)
commitbf7b163896c1c22f5dab5cf81946654f398ea924
tree7efb9664f22fa6cd8cb6fe361f7b4e9702943191
parent60cff50e756264d8cf22348538b4d5ea409405b7
tipc: eliminate case of writing to freed memory

In the function tipc_nodesub_notify() we call a function pointer
aggregated into the object to be notified, whereafter we set
the function pointer to NULL. However, in some cases the function
pointed to will free the struct containing the function pointer,
resulting in a write to already freed memory.

This bug seems to always have been there, without causing any
notable harm.

In this commit we fix the problem by inverting the order of the
zeroing and the function call.

Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/node_subscr.c