<div dir="auto">If ret == 0, then node should not be null. Either that no longer holds, or your static checker is no longer able to deduce that.</div><div class="gmail_extra"><br><div class="gmail_quote">On Dec 12, 2016 7:07 AM, "Dan Carpenter" <<a href="mailto:dan.carpenter@oracle.com">dan.carpenter@oracle.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">[ No idea why it's only complaining about this a year later... -dan ]<br>
<br>
Hello Ben Skeggs,<br>
<br>
This is a semi-automatic email about new static checker warnings.<br>
<br>
The patch b7a2bc1886d0: "drm/nouveau/imem: convert to new-style<br>
nvkm_subdev" from Aug 20, 2015, leads to the following Smatch<br>
complaint:<br>
<br>
drivers/gpu/drm/nouveau/nvkm/<wbr>subdev/instmem/gk20a.c:536 gk20a_instobj_new()<br>
error: we previously assumed 'node' could be null (see line 532)<br>
<br>
drivers/gpu/drm/nouveau/nvkm/<wbr>subdev/instmem/gk20a.c<br>
531 align, &node);<br>
532 *pmemory = node ? &node->memory : NULL;<br>
^^^^<br>
Added a new check for NULL.<br>
<br>
533 if (ret)<br>
534 return ret;<br>
535<br>
536 node->imem = imem;<br>
^^^^^^^^^^<br>
Unchecked dereference.<br>
<br>
537<br>
538 /* present memory for being mapped using small pages */<br>
<br>
regards,<br>
dan carpenter<br>
______________________________<wbr>_________________<br>
Nouveau mailing list<br>
<a href="mailto:Nouveau@lists.freedesktop.org">Nouveau@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/nouveau" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/nouveau</a><br>
</blockquote></div></div>