depmod: Postpone creation of module array
authorJan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Wed, 11 Jan 2012 22:17:38 +0000 (23:17 +0100)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Wed, 11 Jan 2012 22:35:18 +0000 (20:35 -0200)
commit00bd319113c1840a4f05d68c974e377ef36c9430
tree20bc7e61bce5f8711688aaa7e1a516fb45f71a73
parentaf0ff2f22ac189ce9f51b597711aee5c178b0378
depmod: Postpone creation of module array

Deleting modules (we have found replacements) invalidates the indices
because the array collapses removed elements, hitting the assertion.

Since we don't make use of the array until the sorting step, build it from
the modules_by_name hash instead.
tools/kmod-depmod.c