[Nouveau] [Bug 87554] [NV1A] 3.19-rc1 NULL dereference on modprobe in pramin_fini
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Sun Dec 21 07:59:13 PST 2014
https://bugs.freedesktop.org/show_bug.cgi?id=87554
--- Comment #2 from Bruno <bonbons67 at internet.lu> ---
Created attachment 111111
--> https://bugs.freedesktop.org/attachment.cgi?id=111111&action=edit
Consider ->init NULL return as a failure
Things are crashing because pramin_init returns NULL (and not a ERR_PTR).
Would the following change be a proper fix?:
static int
shadow_method(struct nouveau_bios *bios, struct shadow *mthd, const char
*name)
{
const struct nvbios_source *func = mthd->func;
if (func->name) {
nv_debug(bios, "trying %s...\n", name ? name : func->name);
if (func->init) {
mthd->data = func->init(bios, name);
if (IS_ERR(mthd->data)) {
mthd->data = NULL;
return 0;
+ } else if (!mthd->data) {
+ return 0;
}
}
mthd->score = shadow_score(bios, mthd);
if (func->fini)
func->fini(mthd->data);
nv_debug(bios, "scored %d\n", mthd->score);
mthd->data = bios->data;
mthd->size = bios->size;
bios->data = NULL;
bios->size = 0;
}
return mthd->score;
}
If so, please apply attached patch.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/nouveau/attachments/20141221/5e0729b7/attachment.html>
More information about the Nouveau
mailing list