linux/drivers/net/wireless/iwlwifi
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
..
iwl3945-base.c iwlwifi: reduce noise when skb allocation fails 2009-09-23 11:35:53 -04:00
iwl-1000.c iwlwifi: use station HT capabilities and BSS operating mode for Green-field 2009-08-20 11:33:12 -04:00
iwl-3945-fh.h
iwl-3945-hw.h iwlwifi: name changed from "fat" to "ht40" 2009-08-14 09:13:46 -04:00
iwl-3945-led.c iwlwifi: remove command callback return value 2009-07-27 15:24:22 -04:00
iwl-3945-led.h
iwl-3945-rs.c mac80211: add helper for management / no-ack frame rate decision 2009-07-24 15:05:16 -04:00
iwl-3945.c iwlwifi: fix erroneous use of iwl_rx_packet.len as a length 2009-08-20 11:33:13 -04:00
iwl-3945.h iwlwifi: fix up command sending 2009-07-27 15:24:21 -04:00
iwl-4965-hw.h iwlwifi: name changed from "fat" to "ht40" 2009-08-14 09:13:46 -04:00
iwl-4965.c iwlagn: fix panic in iwl{5000,4965}_rx_reply_tx 2009-09-23 11:35:54 -04:00
iwl-5000-hw.h iwlwifi: Temperature sensor voltage reading for 5150 2009-05-22 14:06:03 -04:00
iwl-5000.c iwlagn: fix panic in iwl{5000,4965}_rx_reply_tx 2009-09-23 11:35:54 -04:00
iwl-6000-hw.h
iwl-6000.c iwlwifi: read enhanced tx power info from EEPROM image 2009-08-28 14:40:39 -04:00
iwl-agn-rs.c iwlwifi: find the correct first antenna 2009-09-23 11:35:40 -04:00
iwl-agn-rs.h iwlwifi: remove 60 Mbps from sband bitrates table 2009-08-31 14:42:09 -04:00
iwl-agn.c iwlwifi: fix unloading driver while scanning 2009-08-28 14:40:39 -04:00
iwl-calib.c iwlwifi: automatically adjust sleep level 2009-08-14 09:13:50 -04:00
iwl-calib.h
iwl-commands.h iwlwifi: remove duplicated define 2009-08-28 14:40:38 -04:00
iwl-core.c iwlwifi: disable powersave for 4965 2009-09-23 11:35:40 -04:00
iwl-core.h iwlwifi: disable powersave for 4965 2009-09-23 11:35:40 -04:00
iwl-csr.h iwlwifi: Distinguish power amplifier for 6000 series 2009-08-04 16:44:22 -04:00
iwl-debug.h iwlwifi: show current tx power 2009-08-28 14:40:37 -04:00
iwl-debugfs.c iwlwifi: fix debugfs buffer handling 2009-09-28 16:55:04 -04:00
iwl-dev.h iwlwifi: fix ICT irq table endianness 2009-08-28 14:40:53 -04:00
iwl-eeprom.c iwlwifi: read enhanced tx power info from EEPROM image 2009-08-28 14:40:39 -04:00
iwl-eeprom.h iwlwifi: read enhanced tx power info from EEPROM image 2009-08-28 14:40:39 -04:00
iwl-fh.h
iwl-hcmd.c iwlwifi: Traffic type and counter for debugFs 2009-08-14 09:13:47 -04:00
iwl-helpers.h iwlwifi: change iwl_enable/disable_interrupts to "inline" 2009-07-24 15:05:26 -04:00
iwl-io.h iwlcore: register locks 2009-05-22 14:06:04 -04:00
iwl-led.c iwlwifi: Traffic type and counter for debugFs 2009-08-14 09:13:47 -04:00
iwl-led.h
iwl-power.c iwlwifi: disable powersave for 4965 2009-09-23 11:35:40 -04:00
iwl-power.h iwlwifi: automatically adjust sleep level 2009-08-14 09:13:50 -04:00
iwl-prph.h iwlagn: modify digital SVR for 1000 2009-07-24 15:05:23 -04:00
iwl-rx.c iwlwifi: reduce noise when skb allocation fails 2009-09-23 11:35:53 -04:00
iwl-scan.c iwlwifi: fix unloading driver while scanning 2009-08-28 14:40:39 -04:00
iwl-spectrum.c
iwl-spectrum.h
iwl-sta.c iwlwifi: do not send sync command while holding spinlock 2009-09-23 11:35:53 -04:00
iwl-sta.h iwlwifi: unify station management 2009-06-04 10:56:20 -04:00
iwl-tx.c iwlwifi: remove incorrect uses of ieee80211_get_tx_rate to prevent TX stall 2009-08-31 14:42:09 -04:00
Kconfig iwlwifi: fix LED config option 2009-07-27 15:24:27 -04:00
Makefile iwlwifi: port to cfg80211 rfkill 2009-06-10 13:27:49 -04:00