[process] Hold reference to process during call to step()
authorMichael Brown <mcb30@ipxe.org>
Fri, 13 Jun 2008 02:39:22 +0000 (03:39 +0100)
committerStefan Hajnoczi <stefanha@gmail.com>
Wed, 7 Jul 2010 19:22:19 +0000 (20:22 +0100)
commitf92276bf66b5fcb1c9a32dd7fd2d086e81302544
tree0450c431ed71746d4b555bb82441e588f6b2c7d4
parent5da58bfdf07fdd134de83235d4dc9eb76eab619f
[process] Hold reference to process during call to step()

It is conceivable that the process may terminate during the execution
of step().  If nothing else holds a reference to the containing
object, this would cause the object to be freed prior to returning
from step().

Add a ref_get()/ref_put() around the call to ->step() to prevent this
from happening.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
src/core/process.c