<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <span dir="auto"><<a href="mailto:scan-admin@coverity.com">scan-admin@coverity.com</a>></span><br>Date: Tue, Mar 23, 2021 at 12:22 AM<br>Subject: New Defects reported by Coverity Scan for RTEMS<br>To: <<a href="mailto:build@rtems.org">build@rtems.org</a>><br></div><br><br>Hi,<br>
<br>
Please find the latest report on new defect(s) introduced to RTEMS found with Coverity Scan.<br>
<br>
3 new defect(s) introduced to RTEMS found with Coverity Scan.<br>
<br>
<br>
New defect(s) Reported-by: Coverity Scan<br>
Showing 3 of 3 defect(s)<br>
<br>
<br>
** CID 1474437: Memory - corruptions (ARRAY_VS_SINGLETON)<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1474437: Memory - corruptions (ARRAY_VS_SINGLETON)<br>
/bsps/shared/freebsd/sys/arm/ti/ti_pinmux.c: 480 in beagle_pinctrl_configure_children()<br>
474 int len;<br>
475 uint32_t phandle;<br>
476 <br>
477 for (node = OF_child(parent); node != 0; node = OF_peer(node)) {<br>
478 if (rtems_ofw_node_status(node)) {<br>
479 beagle_pinctrl_configure_children(sc, node);<br>
>>> CID 1474437: Memory - corruptions (ARRAY_VS_SINGLETON)<br>
>>> Passing "&phandle" to function "rtems_ofw_get_enc_prop" which uses it as an array. This might corrupt or misinterpret adjacent memory locations.<br>
480 len = OF_getencprop(node, "pinctrl-0", &phandle, sizeof(phandle));<br>
481 if (len == sizeof(phandle)) {<br>
482 ti_pinmux_configure_pins(sc, phandle);<br>
483 }<br>
484 }<br>
485 }<br>
<br>
** CID 1474436: Memory - corruptions (ARRAY_VS_SINGLETON)<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1474436: Memory - corruptions (ARRAY_VS_SINGLETON)<br>
/bsps/shared/freebsd/sys/arm/ti/ti_pinmux.c: 545 in beagle_pinmux_init()<br>
539 break;<br>
540 default:<br>
541 printk("Unknown CPU in pinmux\n");<br>
542 return ;<br>
543 }<br>
544 <br>
>>> CID 1474436: Memory - corruptions (ARRAY_VS_SINGLETON)<br>
>>> Passing "®" to function "rtems_ofw_get_reg" which uses it as an array. This might corrupt or misinterpret adjacent memory locations.<br>
545 rv = rtems_ofw_get_reg(node, ®, sizeof(reg));<br>
546 if (rv == -1) {<br>
547 printk("pinmux_init: rtems_ofw_get_reg failed %d\n", rv);<br>
548 return ;<br>
549 }<br>
550 pinmux_softc.sc_bsh = reg.start;<br>
<br>
** CID 1474435: (RESOURCE_LEAK)<br>
/bsps/shared/freebsd/sys/arm/ti/ti_pinmux.c: 408 in ti_pinmux_configure_pins()<br>
/bsps/shared/freebsd/sys/arm/ti/ti_pinmux.c: 405 in ti_pinmux_configure_pins()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1474435: (RESOURCE_LEAK)<br>
/bsps/shared/freebsd/sys/arm/ti/ti_pinmux.c: 408 in ti_pinmux_configure_pins()<br>
402 sizeof(*cfgtuples), (void **)&cfgtuples);<br>
403 <br>
404 if (ntuples < 0)<br>
405 return (ENOENT);<br>
406 <br>
407 if (ntuples == 0)<br>
>>> CID 1474435: (RESOURCE_LEAK)<br>
>>> Variable "cfgtuples" going out of scope leaks the storage it points to.<br>
408 return (0); /* Empty property is not an error. */<br>
409 <br>
410 for (i = 0, cfg = cfgtuples; i < ntuples; i++, cfg++) {<br>
411 #ifndef __rtems__<br>
412 if (bootverbose) {<br>
413 char name[32];<br>
/bsps/shared/freebsd/sys/arm/ti/ti_pinmux.c: 405 in ti_pinmux_configure_pins()<br>
399 #endif /* __rtems__ */<br>
400 cfgnode = OF_node_from_xref(cfgxref);<br>
401 ntuples = OF_getencprop_alloc_multi(cfgnode, "pinctrl-single,pins",<br>
402 sizeof(*cfgtuples), (void **)&cfgtuples);<br>
403 <br>
404 if (ntuples < 0)<br>
>>> CID 1474435: (RESOURCE_LEAK)<br>
>>> Variable "cfgtuples" going out of scope leaks the storage it points to.<br>
405 return (ENOENT);<br>
406 <br>
407 if (ntuples == 0)<br>
408 return (0); /* Empty property is not an error. */<br>
409 <br>
410 for (i = 0, cfg = cfgtuples; i < ntuples; i++, cfg++) {<br>
<br>
<br>
________________________________________________________________________________________________________<br>
To view the defects in Coverity Scan visit, <a href="https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypUUzi-2FdSNmuyRB7BEFT8xQ4-2B8hpujh0hTgQljRGId4Dg-3D-3DZ9JC_EU3W9teASMK00lBXX9WT4lsogDrkCcNZLvg-2FVxwAXMrRpCRwRnwhWe3mGbZhfe5TEhVIZWqvzu-2BkK7GzWu18aemlzIGVqBnjE1VG1WYYnqAUylIIGsDE-2BbTTVBzIJdmJneUsK-2BEaTP8-2FdYkzR0L3nGksetaEs-2BWFiyM7otFz-2B3Jlvd7kkQjkZQhm78Hs6VA2e-2BgdMc6t9S3bFnOSaz2HAgqXpiOSsmtmoifKj8QLZB0-3D" rel="noreferrer" target="_blank">https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypUUzi-2FdSNmuyRB7BEFT8xQ4-2B8hpujh0hTgQljRGId4Dg-3D-3DZ9JC_EU3W9teASMK00lBXX9WT4lsogDrkCcNZLvg-2FVxwAXMrRpCRwRnwhWe3mGbZhfe5TEhVIZWqvzu-2BkK7GzWu18aemlzIGVqBnjE1VG1WYYnqAUylIIGsDE-2BbTTVBzIJdmJneUsK-2BEaTP8-2FdYkzR0L3nGksetaEs-2BWFiyM7otFz-2B3Jlvd7kkQjkZQhm78Hs6VA2e-2BgdMc6t9S3bFnOSaz2HAgqXpiOSsmtmoifKj8QLZB0-3D</a><br>
<br>
_______________________________________________<br>
build mailing list<br>
<a href="mailto:build@rtems.org" target="_blank">build@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/build" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/build</a><br>
</div></div>