<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [NV1A] 3.19-rc1 NULL dereference on modprobe in pramin_fini"
href="https://bugs.freedesktop.org/show_bug.cgi?id=87554#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [NV1A] 3.19-rc1 NULL dereference on modprobe in pramin_fini"
href="https://bugs.freedesktop.org/show_bug.cgi?id=87554">bug 87554</a>
from <span class="vcard"><a class="email" href="mailto:bonbons67@internet.lu" title="Bruno <bonbons67@internet.lu>"> <span class="fn">Bruno</span></a>
</span></b>
<pre>Created <span class=""><a href="attachment.cgi?id=111111" name="attach_111111" title="Consider ->init NULL return as a failure">attachment 111111</a> <a href="attachment.cgi?id=111111&action=edit" title="Consider ->init NULL return as a failure">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=87554&attachment=111111'>[review]</a>
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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>