Skip to content

Commit 243c028

Browse files
Mohammed Shafi Shajakhankvalo
authored andcommitted
ath6kl: Fix a debugfs crash for USB devices
Credit distribution stats is currently implemented only for SDIO. This fixes a crash in debugfs for USB interface. BUG: unable to handle kernel NULL pointer dereference at (null) IP: [<f91c2048>] read_file_credit_dist_stats+0x38/0x330 [ath6kl_core] *pde = b62bd067 Oops: 0000 [#1] SMP EIP: 0060:[<f91c2048>] EFLAGS: 00210246 CPU: 0 EIP is at read_file_credit_dist_stats+0x38/0x330 [ath6kl_core] EAX: 00000000 EBX: e6f7a9c0 ECX: e7b148b8 EDX: 00000000 ESI: 000000c8 EDI: e7b14000 EBP: e6e09f64 ESP: e6e09f30 DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 Process cat (pid: 4058, ti=e6e08000 task=e50cf230 task.ti=e6e08000) Stack: 00008000 00000000 e6e09f64 c1132d3c 00004e71 e50cf230 00008000 089e4000 e7b148b8 00000000 e6f7a9c0 00008000 089e4000 e6e09f8c c11331fc e6e09f98 00000001 e6e09f7c f91c2010 e6e09fac e6f7a9c0 089e4877 089e4000 e6e09fac Call Trace: [<c1132d3c>] ? rw_verify_area+0x6c/0x120 [<c11331fc>] vfs_read+0x8c/0x160 [<f91c2010>] ? read_file_war_stats+0x130/0x130 [ath6kl_core] [<c113330d>] sys_read+0x3d/0x70 [<c15755b4>] syscall_call+0x7/0xb [<c1570000>] ? fill_powernow_table_pstate+0x127/0x127 Cc: Ryan Hsu <ryanhsu@qca.qualcomm.com> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
1 parent a41d9a9 commit 243c028

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • drivers/net/wireless/ath/ath6kl

drivers/net/wireless/ath/ath6kl/debug.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,8 +1810,10 @@ int ath6kl_debug_init_fs(struct ath6kl *ar)
18101810
debugfs_create_file("tgt_stats", S_IRUSR, ar->debugfs_phy, ar,
18111811
&fops_tgt_stats);
18121812

1813-
debugfs_create_file("credit_dist_stats", S_IRUSR, ar->debugfs_phy, ar,
1814-
&fops_credit_dist_stats);
1813+
if (ar->hif_type == ATH6KL_HIF_TYPE_SDIO)
1814+
debugfs_create_file("credit_dist_stats", S_IRUSR,
1815+
ar->debugfs_phy, ar,
1816+
&fops_credit_dist_stats);
18151817

18161818
debugfs_create_file("endpoint_stats", S_IRUSR | S_IWUSR,
18171819
ar->debugfs_phy, ar, &fops_endpoint_stats);

0 commit comments

Comments
 (0)