kernel-ark/drivers/net/wireless
Reinette Chatre 2fac9717a0 iwlwifi: fix debugfs buffer handling
We keep track of where to write into a buffer by keeping a count of how
much has been written so far. When writing to the buffer we thus take the
buffer pointer and adding the count of what has been written so far.
Keeping track of what has been written so far is done by incrementing
this number every time something is written to the buffer with how much has
been written at that time.

Currently this number is incremented incorrectly when using the
"hex_dump_to_buffer" call to add data to the buffer. Fix this by only
adding what has been added to the buffer in that call instead of what has
been added since beginning of buffer.

Issue was discovered and discussed during testing of
https://bugzilla.redhat.com/show_bug.cgi?id=464598 .

When a user views any of these files they will see something like:

[  179.355202] ------------[ cut here ]------------
[  179.355209] WARNING: at ../lib/vsprintf.c:989 vsnprintf+0x5ec/0x5f0()
[  179.355212] Hardware name: VGN-Z540N
[  179.355213] Modules linked in: i915 drm i2c_algo_bit i2c_core ipv6 acpi_cpufreq cpufreq_userspace cpufreq_powersave cpufreq_ondemand cpufreq_conservative cpufreq_stats freq_table container sbs sbshc arc4 ecb iwlagn iwlcore joydev led_class mac80211 af_packet pcmcia psmouse sony_laptop cfg80211 iTCO_wdt iTCO_vendor_support pcspkr serio_raw rfkill intel_agp video output tpm_infineon tpm tpm_bios button battery yenta_socket rsrc_nonstatic pcmcia_core processor ac evdev ext3 jbd mbcache sr_mod sg cdrom sd_mod ahci libata scsi_mod ehci_hcd uhci_hcd usbcore thermal fan thermal_sys
[  179.355262] Pid: 5449, comm: cat Not tainted 2.6.31-wl-54419-ge881071 #62
[  179.355264] Call Trace:
[  179.355267]  [<ffffffff811ad14c>] ? vsnprintf+0x5ec/0x5f0
[  179.355271]  [<ffffffff81041348>] warn_slowpath_common+0x78/0xd0
[  179.355275]  [<ffffffff810413af>] warn_slowpath_null+0xf/0x20
[  179.355277]  [<ffffffff811ad14c>] vsnprintf+0x5ec/0x5f0
[  179.355280]  [<ffffffff811ad23d>] ? scnprintf+0x5d/0x80
[  179.355283]  [<ffffffff811ad23d>] scnprintf+0x5d/0x80
[  179.355286]  [<ffffffff811aed29>] ? hex_dump_to_buffer+0x189/0x340
[  179.355290]  [<ffffffff810e91d7>] ? __kmalloc+0x207/0x260
[  179.355303]  [<ffffffffa02a02f8>] iwl_dbgfs_nvm_read+0xe8/0x220 [iwlcore]
[  179.355306]  [<ffffffff811a9b62>] ? __up_read+0x92/0xb0
[  179.355310]  [<ffffffff810f0988>] vfs_read+0xc8/0x1a0
[  179.355313]  [<ffffffff810f0b50>] sys_read+0x50/0x90
[  179.355316]  [<ffffffff8100bd6b>] system_call_fastpath+0x16/0x1b
[  179.355319] ---[ end trace 2383d0d5e0752ca0 ]---

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-09-28 16:55:04 -04:00
..
ath Merge branch 'master' of /home/davem/src/GIT/linux-2.6/ 2009-09-24 15:13:11 -07:00
b43 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 2009-09-23 16:23:46 -07:00
b43legacy b44/b43/b43legacy: Fix switch warnings introduced by SSB-SDIO 2009-09-09 11:19:03 -04:00
hostap hostap: Revert a toxic part of the conversion to net_device_ops 2009-09-23 11:35:39 -04:00
ipw2x00 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 2009-09-02 14:18:09 -07:00
iwlwifi iwlwifi: fix debugfs buffer handling 2009-09-28 16:55:04 -04:00
iwmc3200wifi debugfs: Change debugfs directory of IWMC3200 2009-09-15 09:50:48 -07:00
libertas spi: prefix modalias with "spi:" 2009-09-23 07:39:43 -07:00
libertas_tf mac80211: allow configure_filter callback to sleep 2009-08-20 11:35:58 -04:00
orinoco Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-09-02 00:32:56 -07:00
p54 p54usb: add Zcomax XG-705A usbid 2009-09-23 11:35:41 -04:00
prism54 wireless: convert drivers to netdev_tx_t 2009-09-01 01:14:04 -07:00
rt2x00 rt2x00: fix the definition of rt2x00crypto_rx_insert_iv 2009-09-23 11:35:53 -04:00
rtl818x Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-09-02 00:32:56 -07:00
wl12xx Merge branch 'master' of /home/davem/src/GIT/linux-2.6/ 2009-09-24 15:13:11 -07:00
zd1211rw Merge branch 'master' of /home/davem/src/GIT/linux-2.6/ 2009-09-24 15:13:11 -07:00
adm8211.c mac80211: allow configure_filter callback to sleep 2009-08-20 11:35:58 -04:00
adm8211.h
airo_cs.c
airo.c wireless: convert drivers to netdev_tx_t 2009-09-01 01:14:04 -07:00
airo.h
arlan-main.c wireless: convert drivers to netdev_tx_t 2009-09-01 01:14:04 -07:00
arlan-proc.c sysctl: remove "struct file *" argument of ->proc_handler 2009-09-24 07:21:04 -07:00
arlan.h
at76c50x-usb.c mac80211: remove deprecated API 2009-08-20 11:35:58 -04:00
at76c50x-usb.h
atmel_cs.c
atmel_pci.c
atmel.c trivial: fix typos "man[ae]g?ment" -> "management" 2009-09-21 15:14:56 +02:00
atmel.h
i82586.h
i82593.h
Kconfig wireless: default CONFIG_WLAN to y 2009-09-23 11:35:39 -04:00
mac80211_hwsim.c wireless: convert drivers to netdev_tx_t 2009-09-01 01:14:04 -07:00
Makefile
mwl8k.c mwl8k: separate driver and device info reporting during probe 2009-08-28 14:40:42 -04:00
netwave_cs.c wireless: convert drivers to netdev_tx_t 2009-09-01 01:14:04 -07:00
ray_cs.c wireless: convert drivers to netdev_tx_t 2009-09-01 01:14:04 -07:00
ray_cs.h
rayctl.h
rndis_wlan.c rndis_wlan: fix sparse endianess warnings 2009-09-01 12:48:22 -04:00
strip.c wireless: convert drivers to netdev_tx_t 2009-09-01 01:14:04 -07:00
wavelan_cs.c wireless: convert drivers to netdev_tx_t 2009-09-01 01:14:04 -07:00
wavelan_cs.h
wavelan_cs.p.h wireless: convert drivers to netdev_tx_t 2009-09-01 01:14:04 -07:00
wavelan.c wireless: convert drivers to netdev_tx_t 2009-09-01 01:14:04 -07:00
wavelan.h
wavelan.p.h wireless: convert drivers to netdev_tx_t 2009-09-01 01:14:04 -07:00
wl3501_cs.c wireless: convert drivers to netdev_tx_t 2009-09-01 01:14:04 -07:00
wl3501.h
zd1201.c wireless: convert drivers to netdev_tx_t 2009-09-01 01:14:04 -07:00
zd1201.h