drm/nouveau/imem: convert to new-style nvkm_subdev
[ No idea why it's only complaining about this a year later... -dan ]
Hello Ben Skeggs,
This is a semi-automatic email about new static checker warnings.
The patch b7a2bc1886d0: "drm/nouveau/imem: convert to new-style nvkm_subdev" from Aug 20, 2015, leads to the following Smatch complaint:
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c:536 gk20a_instobj_new()
error: we previously assumed 'node' could be null (see line 532)
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c
531 align, &node);
532 *pmemory = node ? &node->memory : NULL;
^^^^Added a new check for NULL.
533 if (ret)
534 return ret;
535
536 node->imem = imem;
^^^^^^^^^^Unchecked dereference.
537
538 /* present memory for being mapped using small pages */
regards,
dan carpenter
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
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.
Quoted 30 lines · Dan Carpenter
[ No idea why it's only complaining about this a year later... -dan ]
Hello Ben Skeggs,
This is a semi-automatic email about new static checker warnings.
The patch
b7a2bc1886d0: "drm/nouveau/imem: convert to new-stylenvkm_subdev" from Aug 20, 2015, leads to the following Smatch complaint:
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c:536gk20a_instobj_new()
error: we previously assumed 'node' could be null (see line 532)
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c531 align, &node); 532 *pmemory = node ? &node->memory : NULL; ^^^^Added a new check for NULL.
533 if (ret) 534 return ret; 535 536 node->imem = imem; ^^^^^^^^^^Unchecked dereference.
537
538 /* present memory for being mapped using small pages */
Quoted 7 lines
regards,
dan carpenter
_______________________________________________
Nouveau mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau