Re: [PATCH 2/4] stagign: wilc1000: validate cfg parameters before scheduling the work

2018-10-26 Thread Dan Carpenter
On Thu, Oct 25, 2018 at 09:11:00PM +, adham.aboza...@microchip.com wrote: You'll need to resend these because your email from header is in the wrong format. Also there is a typo in the subject. s/stagign/staging/. regards, dan carpenter

Re: [PATCH] ath9k: Fix a locking bug in ath9k_add_interface()

2018-10-24 Thread Dan Carpenter
On Wed, Oct 24, 2018 at 08:50:52AM +0300, Kalle Valo wrote: > Dan Carpenter writes: > > > We tried to revert commit d9c52fd17cb4 ("ath9k: fix tx99 with monitor > > mode interface") but accidentally missed part of the locking change. > > > > The lock has

Re: [PATCH] wireless: airo: potential buffer overflow in sprintf()

2018-10-24 Thread Dan Carpenter
On Wed, Oct 24, 2018 at 11:56:53AM +0300, Kalle Valo wrote: > Dan Carpenter writes: > > > It looks like we wanted to print a maximum of BSSList_rid.ssidLen bytes > > of the ssid, but we accidentally use "%*s" (width) instead of "%.*s" > > (precision)

[PATCH] wireless: airo: potential buffer overflow in sprintf()

2018-10-24 Thread Dan Carpenter
t_mac to %pM") Signed-off-by: Dan Carpenter --- Static analsysis. Not tested. drivers/net/wireless/cisco/airo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/cisco/airo.c b/drivers/net/wireless/cisco/airo.c index 04dd7a936593..5512c7f73fce 100644 --

[PATCH] ath9k: Fix a locking bug in ath9k_add_interface()

2018-10-19 Thread Dan Carpenter
stray unlock before we have taken the lock. Fixes: 6df0580be8bc ("ath9k: add back support for using active monitor interfaces for tx99") Signed-off-by: Dan Carpenter --- drivers/net/wireless/ath/ath9k/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers

[bug report] iwlwifi: mvm: kill INACTIVE queue state

2018-10-17 Thread Dan Carpenter
ret; 1245 /* only unlock sta lock - we still need the queue info lock */ 1246 spin_unlock(>lock); 1247 } regards, dan carpenter

[PATCH] ath10k: htt: remove some dead code

2018-10-11 Thread Dan Carpenter
We added an unnecessary condition here in commit a904417fc876 ("ath10k: add extended per sta tx statistics support"). "legacy_rate_idx" is a u8 so it can't be negative. The caller doesn't pass negatives either. I have deleted this code. Signed-off-by: Dan Carpenter --- I

[bug report] qtnfmac: cleanup and unify command error handling

2018-10-10 Thread Dan Carpenter
d_resp_result_decode(le16_to_cpu(resp->result)); 134 135 pr_warn("VIF%u.%u: cmd 0x%.4X failed: %d\n", 136 mac_id, vif_id, le16_to_cpu(cmd->cmd_id), ret); 137 138 return ret; 139 } regards, dan carpenter

Re: [PATCH v3 00/29] staging: wilc1000: avoid static variables and cleanup changes

2018-10-01 Thread Dan Carpenter
the second iteration Btw, I hate re-reviewing patches and I know everyone hates sending them. If someone complains about a 28/29 or a 29/29, then you can just ask Greg to apply the first 27 and redo the others in a follow on patchset. regards, dan carpenter

[bug report] NFC: st21nfca: Fix some skb memory leaks

2018-09-28 Thread Dan Carpenter
742 kfree_skb(nfcid_skb); 743 return r; 744 } regards, dan carpenter

Re: [PATCH] mac80211: allow scans on radar channels, unless there is CAC or CSA

2018-09-20 Thread Dan Carpenter
quot; because I haven't even looked at it. The bot adds that text to sound more friendly... Presumably the patch is wanted, but I don't know. Anyway, yes, please do send a v2. regards, dan carpenter

Re: [PATCH] mac80211: allow scans on radar channels, unless there is CAC or CSA

2018-09-20 Thread Dan Carpenter
Hi Simon, I love your patch! Perhaps something to improve: url: https://github.com/0day-ci/linux/commits/Simon-Wunderlich/mac80211-allow-scans-on-radar-channels-unless-there-is-CAC-or-CSA/20180919-071924 base: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git master New

Re: [PATCH 29/29] staging: wilc1000: return exact error of register_netdev() from wilc_netdev_init()

2018-09-19 Thread Dan Carpenter
28 goto free_ndev; ret is cleared on the first iteration through the loop. 1129 1130 vif->iftype = STATION_MODE; 1131 vif->mac_opened = 0; 1132 } 1133 1134 return 0; regards, dan carpenter

[bug report] mt76: unify wait_for_mac

2018-09-05 Thread Dan Carpenter
break; 66 default: 67 return true; 68 } 69 usleep_range(5000, 1); 70 } 71 return false; 72 } regards, dan carpenter

[PATCH] cfg80211: fix a type issue in ieee80211_chandef_to_operating_class()

2018-08-31 Thread Dan Carpenter
But really we probably shouldn't have been truncating the high bits away to begin with. Signed-off-by: Dan Carpenter diff --git a/net/wireless/util.c b/net/wireless/util.c index 2a89db5f2db7..4293f980e9c4 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -1456,7 +1456,7 @@ bool iee

Re: [PATCH 20/24] staging: wilc1000: avoid line over 80 chars in tcp_process()

2018-08-27 Thread Dan Carpenter
variable is only used one time and a simple statement becomes two statements and it breaks grep. You could consider renaming some of the variables. I think the "_info" doesn't add anything, because obviously it's information. Maybe "tcp_pending_ack_index" could just become "->ack_idx". vif->ack_filter.pending_ack[tqe->ack_idx].txqe = NULL; It's still very searchable. If you grep for "ack_idx" then the pending and TCP are right there so no information is lost. regards, dan carpenter

Re: [PATCH 23/24] staging: wilc1000: move 'wilc_connecting' static variable to 'wilc_vif' struct

2018-08-23 Thread Dan Carpenter
> > Shouldn't this be a boolean? > > > > Yes, 'connecting' only have value as 0 or 1. I will change it to > bool and rename it to 'is_connecting'. I think just the name "connecting" implies bool so there is no need for the "is_". regards, dan carpenter

[PATCH] rt2x00: use simple_read_from_buffer()

2018-08-22 Thread Dan Carpenter
The problem with this copy_to_user() calls is that they don't ensure that "size" is less than the "length" which the user provided. Obviously, this is debugfs and "size" is normally going to be very small so it probably doesn't matter, but this is the correct th

Re: [PATCH 2/5] staging: wilc1000: fixes for undefined reference to `__this_module' error

2018-08-14 Thread Dan Carpenter
dbg() macros are really very clever. You can enable them for one file or for a specific line or for a function. regards, dan carpenter

[PATCH] libertas_tf: prevent underflow in process_cmdrequest()

2018-08-14 Thread Dan Carpenter
If recvlength is less than MESSAGE_HEADER_LEN (4) we would end up corrupting memory. Fixes: c305a19a0d0a ("libertas_tf: usb specific functions") Signed-off-by: Dan Carpenter --- This is from static analysis. I'm not positive that this is a real bug, but it's harmless to check.

Re: [PATCH] staging: wilc1000: fix undefined reference to `__this_module' compilation error

2018-08-09 Thread Dan Carpenter
On Thu, Aug 09, 2018 at 02:13:24PM +0200, Greg KH wrote: > On Thu, Aug 09, 2018 at 01:43:58PM +0300, Dan Carpenter wrote: > > On Thu, Aug 09, 2018 at 01:08:38PM +0300, Dan Carpenter wrote: > > > On Thu, Aug 09, 2018 at 12:13:06PM +0530, Ajay Singh wrote: > &

Re: [PATCH] staging: wilc1000: fix undefined reference to `__this_module' compilation error

2018-08-09 Thread Dan Carpenter
On Thu, Aug 09, 2018 at 01:08:38PM +0300, Dan Carpenter wrote: > On Thu, Aug 09, 2018 at 12:13:06PM +0530, Ajay Singh wrote: > > wilc_dir = debugfs_create_dir("wilc_wifi", NULL); > > - for (i = 0; i < ARRAY_SIZE(debugfs_info); i++) { &g

Re: [PATCH] staging: wilc1000: fix undefined reference to `__this_module' compilation error

2018-08-09 Thread Dan Carpenter
>data, > - >fops); > + if (IS_ERR_OR_NULL(wilc_dir)) { > + pr_err("Error creating debugfs\n"); > + return -EFAULT; > } Just check for NULL. If someone builds without debugfs enabled in their .config, that's their choice. No need to print a warning. regards, dan carpenter

[bug report] mt76x0: eeprom files

2018-08-06 Thread Dan Carpenter
dev->ee->lna_gain_5ghz[2] = dev->ee->lna_gain_5ghz[0]; 258 else 259 dev->ee->lna_gain_5ghz[2] = gain; 260 } regards, dan carpenter

[bug report] mt76x0: mac files

2018-08-06 Thread Dan Carpenter
439 } 440 rcu_read_unlock(); 441 442 mt76_wr(dev, MT_MAX_LEN_CFG, 0xa0fff | 443 FIELD_PREP(MT_MAX_LEN_CFG_AMPDU, min_factor)); 444 } regards, dan carpenter

[bug report] mt76: add mt76x2_tx_common to mt76x2-common module

2018-08-06 Thread Dan Carpenter
(struct mt76x2_vif *)vif->drv_priv; 43 wcid = >group_wcid; 44 } 45 46 mt76_tx(>mt76, control->sta, wcid, skb); 47 } 48 EXPORT_SYMBOL_GPL(mt76x2_tx); regards, dan carpenter

Re: [PATCH 05/23] staging: wilc1000: rename goto to avoid leading '_' in label name

2018-08-01 Thread Dan Carpenter
Fantastic. Thanks! regards, dan carpenter

Re: [PATCH 05/23] staging: wilc1000: rename goto to avoid leading '_' in label name

2018-07-30 Thread Dan Carpenter
On Mon, Jul 30, 2018 at 03:40:24PM +0530, Ajay Singh wrote: > Hi Dan, > > On Mon, 30 Jul 2018 11:41:13 +0300 > Dan Carpenter wrote: > > > On Fri, Jul 20, 2018 at 04:35:24AM +0530, Ajay Singh wrote: > > > Hi Dan, > > > > > > On Thu, 19 Ju

Re: [PATCH 05/23] staging: wilc1000: rename goto to avoid leading '_' in label name

2018-07-30 Thread Dan Carpenter
On Fri, Jul 20, 2018 at 04:35:24AM +0530, Ajay Singh wrote: > Hi Dan, > > On Thu, 19 Jul 2018 12:27:44 +0300 > Dan Carpenter wrote: > > > On Thu, Jul 19, 2018 at 04:15:01AM +0530, Ajay Singh wrote: > > > diff --git a/drivers/staging/wilc1000/wilc_wlan.c &g

Re: [PATCH 05/23] staging: wilc1000: rename goto to avoid leading '_' in label name

2018-07-19 Thread Dan Carpenter
ret = wilc->hif_func->hif_block_rx_ext(wilc, 0, buffer, size); > > -_end_: > +end: > if (ret) { > offset += size; > wilc->rx_buffer_offset = offset; regards, dan carpenter

Re: [PATCH] staging: wilc1000: fix static checker warning to unlock mutex in wilc_deinit()

2018-07-05 Thread Dan Carpenter
ue_cmd()") With the fixes tag, say someone pulls ff52a57a7a42 into their code, they will know to pull this patch as well. Also scientists will be able to measure the time between bug and fix and write a scholarly paper about it. regards, dan carpenter

Re: New realtek 11ac driver

2018-07-02 Thread Dan Carpenter
nd rtl8xxxu.  That's good news. The OS layer was a failed experiment. It was supposed to give us one driver for everything but instead of that we have at least 7 drivers just within the Linux kernel. We abstracted the wrong thing. regards, dan carpenter

Re: [PATCH V3 2/2] brcmfmac: handle monitor mode marked msgbuf packets

2018-06-20 Thread Dan Carpenter
Hi Rafał, I love your patch! Perhaps something to improve: [auto build test WARNING on wireless-drivers-next/master] [also build test WARNING on v4.18-rc1 next-20180619] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

[bug report] wlcore: sdio: check for valid platform device data before suspend

2018-06-05 Thread Dan Carpenter
} 427 } 428 out: 429 return ret; 430 } regards, dan carpenter

[PATCH] rndis_wlan: potential buffer overflow in rndis_wlan_auth_indication()

2018-06-05 Thread Dan Carpenter
is probably not very severe. Fixes: 030645aceb3d ("rndis_wlan: handle 802.11 indications from device") Signed-off-by: Dan Carpenter diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index 9935bd09db1f..d4947e3a909e 100644 --- a/drivers/net/wireless/rndis_

[bug report] mwifiex: process rxba_sync event

2018-06-04 Thread Dan Carpenter
tmp = (u8 *)tlv_rxba + tlv_len + sizeof(*tlv_rxba); 990 tlv_rxba = (struct mwifiex_ie_types_rxba_sync *)tmp; 991 } 992 } regards, dan carpenter

[bug report] ath9k: Fix issue with MCS15

2018-05-17 Thread Dan Carpenter
RXTX2, 844 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S | 845 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S, 0); 846 847 udelay(200); 848 regards, dan carpenter

[bug report] mwifiex: add rx histogram statistics support

2018-05-17 Thread Dan Carpenter
ments. Obviously it seems like "snr" should be declared as a u8 instead of an s8. But I'm not totally sure what to do about the ->noise_flr and ->sig_str[] arrays. 717 } regards, dan carpenter

[PATCH] cfg80211: Use correct GFP_ mask in cfg80211_del_sta_sinfo()

2018-05-16 Thread Dan Carpenter
fg80211: Expose TXQ stats and parameters to userspace") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index afbe5105bf7f..3eb645b81777 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -14644,7 +14644,7 @

Re: [PATCH 24/30] staging: wilc1000: refactor del_station() to avoid parenthesis misalignment

2018-05-15 Thread Dan Carpenter
&& vif->iftype != GO_MODE) > + return ret; What is "ret" here? I haven't looked at this patch in context, but it's probably zero. Just return the literal. regards, dan carpenter

Re: [PATCH 03/30] staging: wilc1000: fix line over 80 chars in handle_key()

2018-05-15 Thread Dan Carpenter
you may want to also address this, if any. No. Please don't. That kind of thing is sort of an unrelated change from just moving the lines around and it messes up my review scripts. It's really really easy to review the changes when they're split into multiple chunks. regards, dan carpenter

[bug report] Add ath6kl cleaned up driver

2018-05-02 Thread Dan Carpenter
pe (pstream) */ 1194 ath6kl_indicate_tx_activity(wmi->parent_dev, ev->traffic_class, false); 1195 1196 return 0; 1197 } regards, dan carpenter

[bug report] mwifiex: do le_to_cpu conversion for Rx packet header elements

2018-05-02 Thread Dan Carpenter
TH_ALEN); 254 } 255 256 /* Reorder and send to OS */ 257 ret = mwifiex_11n_rx_reorder_pkt(priv, seq_num, local_rx_pd->priority, 258 ta, (u8) rx_pkt_type, skb); 259 regards, dan carpenter

Re: [PATCH] staging: wilc1000: fix infinite loop and out-of-bounds access

2018-05-02 Thread Dan Carpenter
AX_SIZE (4MB) so that's not possible. How many of these structs do we allocate? Is it really worth optimizing the heck out of it? There are times where want to be very deliberate with our types because we're dealing the large numbers, or user data or fast paths. But there are other times where int i

Re: [PATCH] staging: wilc1000: fix infinite loop and out-of-bounds access

2018-04-30 Thread Dan Carpenter
i].ssid_len; 602 slot_id++; 603 } else { 604 ntwk->n_ssids -= 1; 605 } 606 } 607 return 0; 608 609 out_free: 610 611 for (i = 0; i < slot_id ; i--) 612 kfree(ntwk->net_info[i].ssid); 613 614 kfree(ntwk->net_info); 615 out: 616 617 return -ENOMEM; 618 } regards, dan carpenter

Re: [PATCH] rsi: fix a bug in rsi_hal_key_config()

2018-04-27 Thread Dan Carpenter
vger.kernel.org so we can see what's already been sent. regards, dan carpenter

[PATCH] rsi: fix a bug in rsi_hal_key_config()

2018-04-27 Thread Dan Carpenter
Smatch complains that the end of this function is dead code. I'm pretty sure that this return needs to be changed to only return on error. Fixes: 4fd6c4762f37 ("rsi: roaming enhancements") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/

[PATCH] rsi: Uninitialized return value in rsi_reset_card()

2018-04-26 Thread Dan Carpenter
If rsi_usb_master_reg_write() fails then "ret" hasn't been initialized. Fixes: 16d3bb7b2f37 ("rsi: disable fw watchdog timer during reset") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wirele

[PATCH v2] rsi: remove unecessary PTR_ALIGN()s

2018-04-06 Thread Dan Carpenter
ariants. We decided that if the Xtensa people ever notice a bug here then we'll tell them the bug is on their side. ;) Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- v2: Instead of saving the original pointer, just remove the ALIGN()s diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio

Re: [PATCH] rsi: Free the unaligned pointer

2018-04-05 Thread Dan Carpenter
On Thu, Apr 05, 2018 at 02:39:31PM +0300, Dan Carpenter wrote: > On Thu, Apr 05, 2018 at 01:30:35PM +0200, Johannes Berg wrote: > > On Thu, 2018-04-05 at 14:23 +0300, Dan Carpenter wrote: > > > The problem here is that we allocate "data". Then we do > > > &qu

Re: [PATCH] rsi: Free the unaligned pointer

2018-04-05 Thread Dan Carpenter
On Thu, Apr 05, 2018 at 01:30:35PM +0200, Johannes Berg wrote: > On Thu, 2018-04-05 at 14:23 +0300, Dan Carpenter wrote: > > The problem here is that we allocate "data". Then we do > > "data = PTR_ALIGN(data, 8);" and then we free the aligned point

[PATCH] rsi: Free the unaligned pointer

2018-04-05 Thread Dan Carpenter
located. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio.c b/drivers/net/wireless/rsi/rsi_91x_sdio.c index d76e69c0beaa..ca4e698ab69b 100644 --- a/drivers/net/wireless/rsi/rsi_91x_sdio.c +++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c @@

[PATCH] mwifiex: pcie: tighten a check in mwifiex_pcie_process_event_ready()

2018-04-05 Thread Dan Carpenter
If "evt_len" is 1 then we try to memcpy() negative 3 bytes and it would cause memory corruption. Fixes: d930faee141b ("mwifiex: add support for Marvell pcie8766 chipset") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/wireless/marvell

Re: [PATCH 9/9] staging: wilc1000: free memory allocated for general info message from firmware

2018-03-26 Thread Dan Carpenter
On Mon, Mar 26, 2018 at 05:01:50PM +0530, Ajay Singh wrote: > On Mon, 26 Mar 2018 11:32:41 +0300 > Dan Carpenter <dan.carpen...@oracle.com> wrote: > > > What happened to patch 8/9? Anyway, I can't apply this patch and it > > could be my fault or it could be the m

Re: [PATCH 9/9] staging: wilc1000: free memory allocated for general info message from firmware

2018-03-26 Thread Dan Carpenter
What happened to patch 8/9? Anyway, I can't apply this patch and it could be my fault or it could be the missing patch. I don't know... Anwyway, seems like a nice patchset. regards, dan carpenter

Re: [PATCH 4/9] staging: wilc1000: free memory allocated in add wep key functions

2018-03-26 Thread Dan Carpenter
se they're very connected. All the success path is at indent level one so you can just glance at the function and see what it's supposed to do in the normal case. The error handling is self contained at indent level two. regards, dan carpenter

Re: [PATCH 00/11] staging: wilc1000: fix for checkpatch and handled malloc memory properly

2018-03-21 Thread Dan Carpenter
These look good. I've reviewed them all. Reviewed-by: Dan Carpenter <dan.carpen...@oracle.com> I had some small process complaints but it doesn't make life easier for me if you resend them and I have to review everything twice :P regards, dan carpenter

Re: [PATCH 09/11] staging: wilc1000: remove line over 80 char in cfg_connect_result()

2018-03-21 Thread Dan Carpenter
gt;bssid, > +ETH_ALEN); > It basically always helps me if the "new function" changes are in a patch by themselves. These lines are a pure white space changes and I have a script that reviews those for me instantly, but when it's mixed with this patch I have to do it by hand. regards, dan carpenter

Re: [PATCH 06/11] staging: wilc1000: refactor mgmt_tx to fix line over 80 chars

2018-03-21 Thread Dan Carpenter
occurs to me, "Huh, what is 'ret' set to?" So now I have to scroll all the way to the very start of the function... All this scrolling could be avoided if we just did a direct "return 0;" regards, dan carpenter

Re: [PATCH 04/11] staging: wilc1000: refactor WILC_WFI_p2p_rx() to avoid line over 80 char

2018-03-21 Thread Dan Carpenter
This one would have been easier for me to review if it were broken up slightly differently. I have a script to review when people split functions up, but there were a bunch of other stuff so my script gets confused. Anyway, looks good. regards, dan carpenter

Re: [PATCH 01/11] staging: wilc1000: refactor scan() to free kmalloc memory on failure cases

2018-03-20 Thread Dan Carpenter
s looking at holes. > + } > + return true; > + > +out_free: > + > + for (; i >= 0 ; i--) > + kfree(ntwk->net_info[i].ssid); The first kfree(ntwk->net_info[i].ssid); is a no-op. You could write this like: while (--i >= 0) kfree(ntwk->net_info[i].ssid); Or: while (i--) kfree(ntwk->net_info[i].ssid); Or you could do: for (i--; i >= 0 ; i--) kfree(ntwk->net_info[i].ssid); I don't care... regards, dan carpenter

Re: [PATCH 5/7] staging: wilc1000: replace switch statement by simple if condition

2018-03-20 Thread Dan Carpenter
g/wilc1000/wilc_wfi_cfgoperations.c | 8 +--- > > > 1 file changed, 1 insertion(+), 7 deletions(-) > > > > Does not apply to my tree :( > > Hi Greg, > > Sorry about that. Probably there were other patches on the list that were applied first. It's likely not your fault, but just part of the process. > Shall I sent a v2 after rebasing my repo ? Will that > be fine ? Yes. regards, dan carpenter

Re: [PATCH 8/8] staging: wilc1000: fix open parenthesis mismatch issue in wilc_wlan_cfg_set()

2018-02-27 Thread Dan Carpenter
On Tue, Feb 27, 2018 at 06:53:40PM +0530, Ajay Singh wrote: > Hi Dan, > > On Tue, 27 Feb 2018 12:41:40 +0300 > Dan Carpenter <dan.carpen...@oracle.com> wrote: > > > The first 5 patches are good, but the last 3 are not OK. > > Thanks for your review comments. &

Re: [PATCH 7/8] staging: wilc1000: fix line over 80 char in wilc_wlan_cfg_set()

2018-02-27 Thread Dan Carpenter
not just the variable name I have an issue with. I like that I can see CFG_PKTS_TIMEOUT directly instead of having to look for it a few lines back. Don't add unecessary indirection. So just leave this one as-is. Or flip the "if (commit) " condition around and do: if (!commit) return ret_size; regards, dan carpenter

Re: [PATCH 8/8] staging: wilc1000: fix open parenthesis mismatch issue in wilc_wlan_cfg_set()

2018-02-27 Thread Dan Carpenter
t to store a pointer temporarily, so what else are you going to call it besides "tmp"? The name "tmp" doesn't mean "I want a short name and I'm too lazy to think of one". regards, dan carpenter

Re: [PATCH 7/8] staging: wilc1000: fix line over 80 char in wilc_wlan_cfg_set()

2018-02-27 Thread Dan Carpenter
g_set(struct wilc_vif *vif, int start, > u16 wid, u8 *buffer, > wilc->cfg_frame_offset = offset; > > if (commit) { > + unsigned long tmp = msecs_to_jiffies(CFG_PKTS_TIMEOUT); Again. This "tmp" is a bad name here. "tmp" can be

Re: [PATCH 6/8] staging: wilc1000: fix line over 80 char in wilc_wlan_handle_rxq()

2018-02-27 Thread Dan Carpenter
et; > + int tmp; > Heh. Nope. Don't do this. You've just create a "tmp" variable to hold many different types of random long values... It makes the code less readable. Just break it up into separate functions. regards, dan carpenter

Re: [PATCH 1/4] staging: wilc1000: remove use of 'happened' variable in wilc_spi_read_int()

2018-02-22 Thread Dan Carpenter
On Thu, Feb 22, 2018 at 02:09:01PM +0530, Ajay Singh wrote: > Hi Dan, > > On Thu, 22 Feb 2018 10:20:58 +0300 > Dan Carpenter <dan.carpen...@oracle.com> wrote: > > > On Wed, Feb 21, 2018 at 09:42:09PM +0530, Ajay Singh wrote: > > > Modified wilc_spi_re

Re: [PATCH 3/4] staging: wilc1000: refactor wilc_spi_clear_int_ext() by using GENMASK macro

2018-02-21 Thread Dan Carpenter
Please check all these again, right? I've glanced at this and it seems wrong, but I'm too stupid to sure immediately and too lazy to be thourough. regards, dan caprenter

Re: [PATCH 2/4] staging: wilc1000: modified wilc_spi_read_int() by using GENMASK macro

2018-02-21 Thread Dan Carpenter
LONG - 1 - (h int main(void) { int i; u32 mask1, mask2; for (i = 0; i < 32; i++) { mask1 = ~((1ul << i) - 1); mask2 = GENMASK(i - 1, 0); if (mask1 == mask2) continue; printf("ONE 0x%x %d\n", mask1, i); printf("TWO 0x%x\n", mask2); } return 0; } regards, dan carpenter

Re: [PATCH 1/4] staging: wilc1000: remove use of 'happened' variable in wilc_spi_read_int()

2018-02-21 Thread Dan Carpenter
ask); > - happened = 1; > + break; This is flipped around. happened means don't break, but you've changed it to be the opposite. regards, dan carpenter > } > > j++; > - } while (happened); > + } while (1); >

Re: [PATCH 04/12] staging: wilc1000: fix open parenthesis alignment mismatch in wilc_parse_network_info()

2018-02-19 Thread Dan Carpenter
, but I probably would have left this as is. Normally a rule is that the '+' character should be on the first line, and also it's slightly easier to read when the argument is one one line instead of split across two. But it doesn't matter much either way. We'll probably end up re-writing great swaths of this code. regards, dan carpenter

[bug report] NFC: nci: Add HCI over NCI protocol support

2018-02-02 Thread Dan Carpenter
426 instruction = NCI_HCP_MSG_GET_CMD(message->header); 427 skb_pull(skb, NCI_HCI_HCP_MESSAGE_HEADER_LEN); 428 429 nci_hci_hcp_message_rx(hdev->ndev, pipe, 430 type, instruction, skb); 431 } 432 } regards, dan carpenter

Re: [PATCH] wireless: zd1211rw: remove redundant assignment of pointer 'q'

2018-01-31 Thread Dan Carpenter
afterwards being > > re-assigned the same value. Remove the second redundant assignment. > > > > Don't you see strange that in the same context of the patch two users > of q are present? > > How did you test this? > The patch is obviously correct, I don't understand the question. regards, dan carpenter

Re: [PATCH v2 13/14] staging: wilc1000: rename Handle_Connect() to avoid camelCase

2018-01-30 Thread Dan Carpenter
n this patch and resend again. There is no need to re-work the patch. You are right that the NULL check should be added as a separate check. regards, dan carpenter

Re: [PATCH v2 13/14] staging: wilc1000: rename Handle_Connect() to avoid camelCase

2018-01-30 Thread Dan Carpenter
this warning was introduced in patch 9 so I don't know why the script is responding to patch 13. I would have expect it to reply to patch 9 (because that's where the warning is introduced) or patch 0 or patch 14 (if it's testing the whole patchset instead of individual patches). regards, dan carpenter

Re: [bug report] mt76: fix transmission of encrypted management frames

2018-01-30 Thread Dan Carpenter
On Tue, Jan 30, 2018 at 03:39:56PM +0300, Dan Carpenter wrote: > Hello Felix Fietkau, > > The patch 23405236460b: "mt76: fix transmission of encrypted > management frames" from Jan 18, 2018, leads to the following static > checker warning: > > drivers/net/wir

[bug report] mt76: fix transmission of encrypted management frames

2018-01-30 Thread Dan Carpenter
6 } 47 48 mt76_tx(>mt76, control->sta, wcid, skb); 49 } regards, dan carpenter

Re: [PATCH v2 02/14] staging: wilc1000: removed unnecessary defined enums typedef

2018-01-22 Thread Dan Carpenter
s a real pain. There are some people I just don't send patches to because they are too much headache to deal with. regards, dan carpenter

Re: [PATCH 04/14] staging: wilc1000: rename host_int_ParseJoinBssParam() and it's variable using camelCase

2018-01-19 Thread Dan Carpenter
one, I do `cat | rename_rev.pl -a` regards, dan carpenter #!/usr/bin/perl # This is a tool to help review variable rename patches. The goal is # to strip out the automatic sed renames and the white space changes # and leaves the interesting code changes. # # Example 1: A patch renames openInfo to open_info:

[bug report] mt76: add driver code for MT76x2e

2017-12-14 Thread Dan Carpenter
457 if (!txq) ^^^ Check is too late. 458 return -EINVAL; 459 regards, dan carpenter

[bug report] mt76: add driver code for MT76x2e

2017-12-14 Thread Dan Carpenter
^^ Unchecked dereference 190 max_txpwr_adj = wcid->max_txpwr_adj; 191 nss = wcid->tx_rate_nss; regards, dan carpenter

[PATCH] ath9k_htc: Add a sanity check in ath9k_htc_ampdu_action()

2017-12-05 Thread Dan Carpenter
ot; is less than ATH9K_HTC_MAX_TID (8) so checking here makes things more consistent. Fixes: fb9987d0f748 ("ath9k_htc: Support for AR9271 chipset.") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- This might be fine. I see lots of other drivers don't check tid. diff --git

[bug report] mac80211: fix VLAN handling with TXQs

2017-11-15 Thread Dan Carpenter
} else if (ieee80211_hw_check(>hw, QUEUE_CONTROL)) { 3531 ieee80211_free_txskb(>hw, skb); regards, dan carpenter

Re: [PATCH] staging: wilc1000: Fix bssid buffer offset in Txq

2017-11-04 Thread Dan Carpenter
This driver really needs proper structs and datatypes so this doesn't happen again and so that you and Colin stop reverting each other's *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 8) & 0xFF); assignments: regards, dan carpenter

Re: [PATCH] staging: wilc1000: replace redundant computations with 0

2017-10-23 Thread Dan Carpenter
ti->enabled >> 8) & 0xFF); > - *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 16) & 0xFF); > - *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 24) & 0xFF); > + *pu8CurrByte++ = 0; > + *pu8CurrByte++ = 0; > + *pu8CurrByte++ = 0; This is harder to understand now. I would be better to solve this by declaring a struct with the right format and using cpu_to_be32(). regards, dan carpenter

Re: Two rtlwifi drivers?

2017-10-11 Thread Dan Carpenter
a new thing. regards, dan carpenter

[PATCH 2/2] rtlwifi: silence underflow warning

2017-09-29 Thread Dan Carpenter
My static checker complains that we have an upper bound but no lower bound. I suspect neither are really required but it doesn't hurt to add a check for negatives. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drive

[bug report] NFC: st21nfcb: Add support for secure element

2017-09-25 Thread Dan Carpenter
d); pipe comes from skb->data[]. The call tree is: nci_hci_msg_rx_work <-- gets pipe from skb->data[0] -> nci_hci_hcp_message_rx --> nci_hci_event_received --> st_nci_hci_event_received <-- off by one regards, dan carpenter

[bug report] iwlwifi: mvm: add station before allocating a queue

2017-09-01 Thread Dan Carpenter
ldn't we set *status = 0;? 166 } else if (ret) { 167 return ret; 168 } 169 170 pkt = cmd->resp_pkt; regards, dan carpenter

[PATCH 1/2] rsi: missing unlocks on error paths

2017-08-25 Thread Dan Carpenter
There is a missing unlock if rsi_find_sta() fails in rsi_mac80211_ampdu_action() or if we hit the -EINVAL path in rsi_mac80211_sta_add(). Fixes: 3528608f3a79 ("rsi: handle station connection in AP mode") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/driv

[PATCH 2/2] rsi: update some comments

2017-08-25 Thread Dan Carpenter
These functions don't return -1 on failure. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c index 25331aa16e8e..e78e87e99804 100644 --- a/drivers/net/wireless/rsi/rsi_91x_mac8

[PATCH] staging: rtlwifi: check for array overflow

2017-08-24 Thread Dan Carpenter
Smatch is distrustful of the "capab" value and marks it as user controlled. I think it actually comes from the firmware? Anyway, I looked at other drivers and they added a bounds check and it seems like a harmless thing to have so I have added it here as well. Signed-off-by: Dan

[bug report] rsi: data and managemet path changes for AP mode

2017-08-23 Thread Dan Carpenter
tid, 0); 401 } 402 } 403 } regards, dan carpenter

[PATCH] rtlwifi: make a couple arrays larger

2017-08-18 Thread Dan Carpenter
o it looks like we could corrupt memory. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- I'm pretty sure this patch is correct and absolutely harmless. But the code is pretty involved and I didn't test it. So you may want to review this one carefully. diff --git a/drivers/net/wi

[bug report] rsi: add support for U-APSD power save

2017-08-10 Thread Dan Carpenter
rsi_dbg(INFO_ZONE, "Configuring UAPSD\n"); 578 rsi_conf_uapsd(adapter); 579 } 580 } else { 581 common->uapsd_bitmap = 0; 582 } 583 } 584 585 if (changed & BSS_CHANGED_CQM) { regards, dan carpenter

[bug report] rsi: immediate wakeup bit and priority for TX command packets

2017-08-01 Thread Dan Carpenter
tx_queue[MGMT_SOFT_Q], skb); 282 rsi_set_event(>tx_thread.event); 283 return 0; 284 } regards, dan carpenter

Re: [PATCH] iwlwifi: pcie: Fix error code in iwl_trans_pcie_alloc()

2017-07-19 Thread Dan Carpenter
Oops, heh, sorry. I switched computers so I first one wasn't in my outbox. regards, dan carpenter

Re: [PATCH] rtlwifi: rtl8821ae: Fix HW_VAR_NAV_UPPER operation

2017-07-15 Thread Dan Carpenter
On Fri, Jul 14, 2017 at 02:09:46PM -0500, Larry Finger wrote: > On 07/13/2017 02:43 AM, Dan Carpenter wrote: > > The cast here is wrong. We want to cast the pointer but we accidentally > > do a no-op cast of the value. We normally want to set us_nav_upper to > > WIF

[PATCH] rtlwifi: rtl8821ae: Fix HW_VAR_NAV_UPPER operation

2017-07-13 Thread Dan Carpenter
("Staging: rtl8812ae: Add Realtek 8821 PCI WIFI driver") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c index 2bc6bace069c..230f92a48f3c 100644 --- a/driv

  1   2   3   4   >