Message ID | 1360834689-11187-1-git-send-email-mohammed@qca.qualcomm.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> writes: > From: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> > > 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 [...] > --- a/drivers/net/wireless/ath/ath6kl/debug.c > +++ b/drivers/net/wireless/ath/ath6kl/debug.c > @@ -658,6 +658,9 @@ static ssize_t read_file_credit_dist_stats(struct file *file, > unsigned int buf_len, len = 0; > ssize_t ret_cnt; > > + if (ar->hif_type != ATH6KL_HIF_TYPE_SDIO) > + return -EINVAL; Actually I think it would be better not to even create the debugfs when using sdio.
Hi Kalle, On 02/15/2013 04:00 PM, Kalle Valo wrote: > Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> writes: > >> From: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> >> >> 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 > > [...] > >> --- a/drivers/net/wireless/ath/ath6kl/debug.c >> +++ b/drivers/net/wireless/ath/ath6kl/debug.c >> @@ -658,6 +658,9 @@ static ssize_t read_file_credit_dist_stats(struct file *file, >> unsigned int buf_len, len = 0; >> ssize_t ret_cnt; >> >> + if (ar->hif_type != ATH6KL_HIF_TYPE_SDIO) >> + return -EINVAL; > > Actually I think it would be better not to even create the debugfs when > using sdio. agreed, but looks bit ugly right ? thoughts. >
Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> writes: >>> + if (ar->hif_type != ATH6KL_HIF_TYPE_SDIO) >>> + return -EINVAL; >> >> Actually I think it would be better not to even create the debugfs when >> using sdio. Oops, meant of course s/debugfs/debugfs file/. There seems to be packet loss between my brains and fingers... > agreed, but looks bit ugly right ? thoughts. Sorry, but I don't understand how not creating the debugfs file for usb would be ugly? But this isn't that important, if you want we can do it like you propose as well.
On 02/15/2013 05:13 PM, Kalle Valo wrote: > Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> writes: > >>>> + if (ar->hif_type != ATH6KL_HIF_TYPE_SDIO) >>>> + return -EINVAL; >>> >>> Actually I think it would be better not to even create the debugfs when >>> using sdio. > > Oops, meant of course s/debugfs/debugfs file/. There seems to be packet > loss between my brains and fingers... yeah I think its USB and debugfs file :) > >> agreed, but looks bit ugly right ? thoughts. > > Sorry, but I don't understand how not creating the debugfs file for usb > would be ugly? But this isn't that important, if you want we can do it > like you propose as well. > I will cook up a new patch, please see if that's fine :)
diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c index 15cfe30..0dbb67b 100644 --- a/drivers/net/wireless/ath/ath6kl/debug.c +++ b/drivers/net/wireless/ath/ath6kl/debug.c @@ -658,6 +658,9 @@ static ssize_t read_file_credit_dist_stats(struct file *file, unsigned int buf_len, len = 0; ssize_t ret_cnt; + if (ar->hif_type != ATH6KL_HIF_TYPE_SDIO) + return -EINVAL; + buf_len = CREDIT_INFO_DISPLAY_STRING_LEN + get_queue_depth(&target->cred_dist_list) * CREDIT_INFO_LEN; buf = kzalloc(buf_len, GFP_KERNEL);