public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] MPC85xx: Uninitialized variables and other problems
@ 2014-11-06 11:54 Wolfgang Denk
  2014-11-06 23:31 ` York Sun
  0 siblings, 1 reply; 2+ messages in thread
From: Wolfgang Denk @ 2014-11-06 11:54 UTC (permalink / raw)
  To: u-boot

Hello,

cppcheck reports:

[arch/powerpc/cpu/mpc85xx/cmd_errata.c:62]: (error) Uninitialized variable: x108

[board/freescale/common/cds_pci_ft.c:36]: (error) Possible null pointer dereference: map
[board/freescale/common/cds_pci_ft.c:52]: (error) Uninitialized variable: len

[board/freescale/t4qds/eth.c:289]: (error) Undefined behavior: Variable 'buf' is used as parameter and destination in s[n]printf().
[board/freescale/t4qds/eth.c:298]: (error) Undefined behavior: Variable 'buf' is used as parameter and destination in s[n]printf().
[board/freescale/t4qds/eth.c:307]: (error) Undefined behavior: Variable 'buf' is used as parameter and destination in s[n]printf().
[board/freescale/t4qds/eth.c:316]: (error) Undefined behavior: Variable 'buf' is used as parameter and destination in s[n]printf().

[drivers/ddr/fsl/ctrl_regs.c:1659]: (error) Uninitialized variable: wr
[drivers/ddr/fsl/ctrl_regs.c:2257]: (error) Uninitialized variable: ea
[drivers/ddr/fsl/ctrl_regs.c:2256]: (error) Uninitialized variable: sa
[drivers/ddr/fsl/ctrl_regs.c:1985]: (error) Uninitialized variable: zqcs_init

[drivers/mmc/fsl_esdhc_spl.c:95]: (error) Dereferencing 'tmp_buf' after it is deallocated / released
[drivers/mmc/fsl_esdhc_spl.c:98]: (error) Memory pointed to by 'tmp_buf' is freed twice.
[drivers/mmc/fsl_esdhc_spl.c:101]: (error) Dereferencing 'tmp_buf' after it is deallocated / released
[drivers/mmc/fsl_esdhc_spl.c:104]: (error) Memory pointed to by 'tmp_buf' is freed twice.



Can you please have a look and fix these?

Thanks in advance.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A person who is more than casually interested in computers should  be
well  schooled in machine language, since it is a fundamental part of
a computer.                                           -- Donald Knuth

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [U-Boot] MPC85xx: Uninitialized variables and other problems
  2014-11-06 11:54 [U-Boot] MPC85xx: Uninitialized variables and other problems Wolfgang Denk
@ 2014-11-06 23:31 ` York Sun
  0 siblings, 0 replies; 2+ messages in thread
From: York Sun @ 2014-11-06 23:31 UTC (permalink / raw)
  To: u-boot

On 11/06/2014 03:54 AM, Wolfgang Denk wrote:
> Hello,
> 
> cppcheck reports:
> 
> [arch/powerpc/cpu/mpc85xx/cmd_errata.c:62]: (error) Uninitialized variable: x108
> 
> [board/freescale/common/cds_pci_ft.c:36]: (error) Possible null pointer dereference: map
> [board/freescale/common/cds_pci_ft.c:52]: (error) Uninitialized variable: len
> 
> [board/freescale/t4qds/eth.c:289]: (error) Undefined behavior: Variable 'buf' is used as parameter and destination in s[n]printf().
> [board/freescale/t4qds/eth.c:298]: (error) Undefined behavior: Variable 'buf' is used as parameter and destination in s[n]printf().
> [board/freescale/t4qds/eth.c:307]: (error) Undefined behavior: Variable 'buf' is used as parameter and destination in s[n]printf().
> [board/freescale/t4qds/eth.c:316]: (error) Undefined behavior: Variable 'buf' is used as parameter and destination in s[n]printf().
> 
> [drivers/ddr/fsl/ctrl_regs.c:1659]: (error) Uninitialized variable: wr
> [drivers/ddr/fsl/ctrl_regs.c:2257]: (error) Uninitialized variable: ea
> [drivers/ddr/fsl/ctrl_regs.c:2256]: (error) Uninitialized variable: sa
> [drivers/ddr/fsl/ctrl_regs.c:1985]: (error) Uninitialized variable: zqcs_init
> 
> [drivers/mmc/fsl_esdhc_spl.c:95]: (error) Dereferencing 'tmp_buf' after it is deallocated / released
> [drivers/mmc/fsl_esdhc_spl.c:98]: (error) Memory pointed to by 'tmp_buf' is freed twice.
> [drivers/mmc/fsl_esdhc_spl.c:101]: (error) Dereferencing 'tmp_buf' after it is deallocated / released
> [drivers/mmc/fsl_esdhc_spl.c:104]: (error) Memory pointed to by 'tmp_buf' is freed twice.
> 
> 
> 
> Can you please have a look and fix these?
> 
> Thanks in advance.

Yes I will look into them when I have a chance.

York

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-06 23:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-06 11:54 [U-Boot] MPC85xx: Uninitialized variables and other problems Wolfgang Denk
2014-11-06 23:31 ` York Sun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox