module: Assign the index before calling init()
authorTanu Kaskinen <tanu.kaskinen@intel.com>
Mon, 29 Apr 2013 13:46:13 +0000 (16:46 +0300)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Mon, 3 Jun 2013 19:08:41 +0000 (00:38 +0530)
commitaacac20e765c8ce9176e1fd9b25a07c1bf6b6838
tree241ad29846e53dae2d0f493241b13f5b840ddc70
parent6cc974844e6efde880d431cb7c4bfb7259a5bd4b
module: Assign the index before calling init()

Any code that runs inside the init() callback sees an invalid module
index. Sometimes init() does things that cause hooks to be fired. This
means that any code that uses hooks may see an invalid module index.
Fix this by assigning the module index before init() is called.

There are no known issues in the upstream code base where an invalid
module index would be used, but an out-of-tree module
(module-murphy-ivi) had a problem with this.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=63923
src/pulsecore/module.c