Bug 39102

Summary: p54usb.c memory leak and eeprom.c has unassigned values
Product: Drivers Reporter: DJ Cozatt (ygdrasil)
Component: network-wirelessAssignee: drivers_network-wireless (drivers_network-wireless)
Status: RESOLVED WILL_NOT_FIX    
Severity: normal CC: alan, chunkeey, linville, ygdrasil
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.39 Subsystem:
Regression: No Bisected commit-id:

Description DJ Cozatt 2011-07-10 03:24:32 UTC
david@random /usr/src/linux/drivers/net/wireless/p54 $ cppcheck . -f --enable=all 2> /home/david/p54-errors.txt

david@random /usr/src/linux/drivers/net/wireless/p54 $ cppcheck --version
Cppcheck 1.48

Linux random 2.6.39-gentoo-r2 #3 SMP Wed Jul 6 15:21:54 EDT 2011 x86_64 Intel(R) Pentium(R) 4 CPU 2.80GHz GenuineIntel GNU/Linux

Not sure the unassigned values might not be a false positive but reporting anyway.

[eeprom.c:398]: (style) Variable 'dst' is not assigned a value
[eeprom.c:399]: (style) Variable 'src' is not assigned a value
[p54usb.c:367]: (error) Memory leak: reg
Comment 1 Christian Lamparter 2011-07-11 18:26:52 UTC
dst and src are used by sizeof to save some "excessive"
sizeof(struct p54_abcdefg). if you want to can post a patch
which replace both aliases.

the p54usb.c "error" looks like a false-positive. In fact there's a
note in p54usb.c at line 333 which tells you why it should not leak.

Regards,
    Chr