How to port rtl8xxxu to new device...?

2021-01-17 Thread Alex Dewar
Hi all, I'm currently trying to port the rtl8xxxu driver to RTL8822u chips (one of which I own), but I'm finding it hard to figure out where to start and I figured that some wiser minds could maybe help steer me in the right direction. I've managed to get as far as reading and writing to various

Re: [PATCH 2/2] ath11k: Handle errors if peer creation fails

2020-11-07 Thread Alex Dewar
On Sat, Nov 07, 2020 at 01:23:30PM +0200, Kalle Valo wrote: > Alex Dewar writes: > > > On Tue, Oct 06, 2020 at 10:26:28AM +0300, Kalle Valo wrote: > >> Alex Dewar writes: > >> > >> > ath11k_peer_create() is called without its return value being checke

Re: [PATCH] net/sunrpc: Fix return value from proc_do_xprt()

2020-11-07 Thread Alex Dewar
nd sorry for the noise! > > On Sat, Oct 24, 2020 at 03:52:40PM +0100, Alex Dewar wrote: > > Commit c09f56b8f68d ("net/sunrpc: Fix return value for sysctl > > sunrpc.transports") attempted to add error checking for the call to > > memory_read_from_buffer(), however

[PATCH] net/sunrpc: Fix return value from proc_do_xprt()

2020-10-24 Thread Alex Dewar
s-Coverity-ID: 1498033: Control flow issues (NO_EFFECT) Fixes: c09f56b8f68d ("net/sunrpc: Fix return value for sysctl sunrpc.transports") Signed-off-by: Alex Dewar --- net/sunrpc/sysctl.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/sunrpc/sysctl.c b

Re: [PATCH] net: sockmap: Don't call bpf_prog_put() on NULL pointer

2020-10-14 Thread Alex Dewar
On 14/10/2020 10:32, Jakub Sitnicki wrote: On Mon, Oct 12, 2020 at 07:09 PM CEST, Alex Dewar wrote: If bpf_prog_inc_not_zero() fails for skb_parser, then bpf_prog_put() is called unconditionally on skb_verdict, even though it may be NULL. Fix and tidy up error path. Addresses-Coverity-ID

[PATCH] net: sockmap: Don't call bpf_prog_put() on NULL pointer

2020-10-12 Thread Alex Dewar
t and skb_parser programs explicitly") Signed-off-by: Alex Dewar --- net/core/sock_map.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/net/core/sock_map.c b/net/core/sock_map.c index df09c39a4dd2..a73ccce54423 100644 --- a/net/core/sock_map.c +++

Re: [PATCH] net/mlx5e: Fix freeing of unassigned pointer

2020-10-07 Thread Alex Dewar
On Tue, Oct 06, 2020 at 04:22:12PM -0700, Saeed Mahameed wrote: > On Sat, 2020-10-03 at 12:10 +0100, Alex Dewar wrote: > > Commit ff7ea04ad579 ("net/mlx5e: Fix potential null pointer > > dereference") > > added some missing null checks but the error handling in

Re: [PATCH 2/2] ath11k: Handle errors if peer creation fails

2020-10-06 Thread Alex Dewar
On Tue, Oct 06, 2020 at 10:26:28AM +0300, Kalle Valo wrote: > Alex Dewar writes: > > > ath11k_peer_create() is called without its return value being checked, > > meaning errors will be unhandled. Add missing check and, as the mutex is > > unconditionally unlocked

[PATCH 2/2] ath11k: Handle errors if peer creation fails

2020-10-04 Thread Alex Dewar
ot;) Fixes: 701e48a43e15 ("ath11k: add packet log support for QCA6390") Signed-off-by: Alex Dewar --- drivers/net/wireless/ath/ath11k/mac.c | 21 + 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/at

[PATCH 1/2] ath11k: Fix memory leak on error path

2020-10-04 Thread Alex Dewar
In ath11k_mac_setup_iface_combinations(), if memory cannot be assigned for the variable limits, then the memory assigned to combinations will be leaked. Fix this. Addresses-Coverity-ID: 1497534 ("Resource leaks") Fixes: 2626c269702e ("ath11k: add interface_modes to hw_params")

[PATCH] net/mlx5e: Fix freeing of unassigned pointer

2020-10-03 Thread Alex Dewar
. Fix this. Addresses-Coverity-ID: 1497536 ("Memory - illegal accesses") Fixes: ff7ea04ad579 ("net/mlx5e: Fix potential null pointer dereference") Signed-off-by: Alex Dewar --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 17 + 1 file changed, 9 insertions(+)

[PATCH v2] net/mlx5e: Fix use of freed pointer

2020-09-29 Thread Alex Dewar
quot;net/mlx5e: CT: Use the same counter for both directions") Signed-off-by: Alex Dewar --- v2: - Add Fixes tag (Leon) - Use ERR_CAST (Leon) Hi Leon, I've made the suggested changes. Let me know if there's anything else you need :) There is also this patch in t

[PATCH] dpaa2-mac: Fix potential null pointer dereference

2020-09-27 Thread Alex Dewar
In dpaa2_pcs_destroy, variable pcs is dereference before it is null-checked. Fix this. Addresses-Coverity: CID 1497159: Null pointer dereferences (REVERSE_INULL) Signed-off-by: Alex Dewar --- drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions

[PATCH] ath11k: Correctly check errors for calls to debugfs_create_dir()

2020-09-27 Thread Alex Dewar
accesses (USE_AFTER_FREE) Addresses-Coverity: CID 1497160: Memory - illegal accesses (USE_AFTER_FREE) Signed-off-by: Alex Dewar --- drivers/net/wireless/ath/ath11k/debugfs.c | 25 +-- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k

[PATCH 3/3] net/mlx5e: Fix use of freed pointer

2020-09-27 Thread Alex Dewar
If the call to mlx5_fc_create() fails, then shared_counter will be freed before its member, shared_counter->counter, is accessed to retrieve the error code. Fix by using an intermediate variable. Addresses-Coverity: CID 1497153: Memory - illegal accesses (USE_AFTER_FREE) Signed-off-by: Alex De

[PATCH 2/3] net/mlx5e: Clean up error handling in mlx5e_alloc_flow()

2020-09-27 Thread Alex Dewar
-off-by: Alex Dewar --- .../net/ethernet/mellanox/mlx5/core/en_tc.c | 20 ++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index b3c57b984a2a..ed308407be6f 100644

[PATCH 1/3] net/mlx5e: Fix possible null pointer dereference

2020-09-27 Thread Alex Dewar
(FORWARD_NULL) Signed-off-by: Alex Dewar --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index f815b0c60a6c..b3c57b984a2a

[PATCH 0/3] net/mlx5e: Fix some static analysis warnings

2020-09-27 Thread Alex Dewar
Hi, Coverity has flagged up some warnings for this driver, which I address in this patch series. All the fixes are fairly trivial and have been build-tested. Best, Alex

Re: [PATCH v2] ath10k: sdio: remove redundant check in for loop

2020-09-27 Thread Alex Dewar
> I agree. Anyone can come up with a patch? Hi Kalle, I was thinking of having a go at this. Have you applied the v2 of this patch yet though? I couldn't see it in wireless-drivers-next. I just don't want to have to rebase the patch if you were going to apply this v2. Best, Alex > > -- > http

[PATCH] wl3501_cs: Remove unnecessary NULL check

2020-09-26 Thread Alex Dewar
ned-off-by: Alex Dewar --- drivers/net/wireless/wl3501_cs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c index 4e7a2140649b..026e88b80bfc 100644 --- a/drivers/net/wireless/wl3501_cs.c +++ b/drivers/net/wirel

[PATCH v3] net: dsa: mt7530: Add some return-value checks

2020-09-24 Thread Alex Dewar
call stack. Fixes: c288575f7810 ("net: dsa: mt7530: Add the support of MT7531 switch") Addresses-Coverity: 1496993 ("Uninitialized variables") Signed-off-by: Alex Dewar --- Hi Landen, Here you go! v3: - fix checkpatch warning about braces (Landen) v2:

Re: [PATCH v2] net: dsa: mt7530: Add some return-value checks

2020-09-24 Thread Alex Dewar
On 2020-09-24 13:13, Landen Chao wrote: Hi Alex, Thanks for your patch. By linux/scripts/checkpatch.pl On Sun, 2020-09-20 at 03:28 +0800, Alex Dewar wrote: [..] @@ -1631,9 +1635,11 @@ mt7530_setup(struct dsa_switch *ds) mt7530_rmw(priv, MT7530_PCR_P(i), PCR_MATRIX_MASK

[PATCH v2] net: dsa: mt7530: Add some return-value checks

2020-09-19 Thread Alex Dewar
call stack. Fixes: c288575f7810 ("net: dsa: mt7530: Add the support of MT7531 switch") Addresses-Coverity: 1496993 ("Uninitialized variables") Signed-off-by: Alex Dewar --- v2: - fix typo in commit message - split variable declarations onto multiple lines (Gu

Re: [PATCH] net: dsa: mt7530: Add some return-value checks

2020-09-16 Thread Alex Dewar
On Wed, Sep 16, 2020 at 08:50:17PM +0100, Alex Dewar wrote: > In mt7531_cpu_port_config(), if the variable port is neither 5 nor 5, This should read "neither 5 nor 6", obviously. I'll fix in v2.

Re: [PATCH] net: dsa: mt7530: Add some return-value checks

2020-09-16 Thread Alex Dewar
[snip] > > > > /* Enable Mediatek header mode on the cpu port */ > > mt7530_write(priv, MT7530_PVC_P(port), > > @@ -2275,7 +2279,7 @@ mt7531_cpu_port_config(struct dsa_switch *ds, int > > port) > > { > > struct mt7530_priv *priv = ds->priv; > > phy_interface_t interface; > > -

[PATCH] i40e: Fix use of uninitialized variable

2020-09-16 Thread Alex Dewar
quot;) Signed-off-by: Alex Dewar --- drivers/net/ethernet/intel/i40e/i40e_xsk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b/drivers/net/ethernet/intel/i40e/i40e_xsk.c index 6acede0acdca..18c05d23e15e 100644 --- a/drivers/net

Re: [PATCH] ath10k: sdio: remove reduntant check in for loop

2020-09-16 Thread Alex Dewar
[snip] 'i' is only referenced once inside the loop to check boundary, the loop is actually iterating over cur_section, so i would make it clear in the loop statement, e.g.: Remove the break condition and the cur_section assignment at the end of the loop and use the loop statement to do it for yo

[PATCH] net: dsa: mt7530: Add some return-value checks

2020-09-16 Thread Alex Dewar
sa: mt7530: Add the support of MT7531 switch") Signed-off-by: Alex Dewar --- If it is not expected that these functions will throw errors (i.e. because the parameters passed will always be correct), we could dispense with the use of EINVAL errors and just use BUG*() macros instead. Let me kn

[PATCH v2] ath10k: sdio: remove redundant check in for loop

2020-09-16 Thread Alex Dewar
;Null pointer dereferences) Suggested-by: Saeed Mahameed Signed-off-by: Alex Dewar --- v2: refactor in the manner suggested by Saeed drivers/net/wireless/ath/ath10k/sdio.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/driver

[PATCH] ath10k: sdio: remove reduntant check in for loop

2020-09-14 Thread Alex Dewar
erity: 1496984 ("Null pointer dereferences) Signed-off-by: Alex Dewar --- drivers/net/wireless/ath/ath10k/sdio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c index 81ddaafb6721..f31ab2ec2

[PATCH] net: mvpp2: ptp: Fix unused variables

2020-09-10 Thread Alex Dewar
initialised. Fix by assigning to link the value of the bit test. Build-tested on x86. Fixes: 36cfd3a6e52b ("net: mvpp2: restructure "link status" interrupt handling") Signed-off-by: Alex Dewar --- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 6 ++ 1 file changed, 2 insert

[PATCH] xsk: Free variable on error path

2020-09-02 Thread Alex Dewar
In xp_create_dma_map(), memory is allocated to dma_map->dma_pages, but then dma_map is erroneously compared to NULL, rather than the member. Fix this. Addresses-Coverity: ("Dead code") Fixes: 921b68692abb ("xsk: Enable sharing of dma mappings") Signed-off-by: A

[PATCH v2] netlabel: remove unused param from audit_log_format()

2020-08-28 Thread Alex Dewar
ode") Fixes: d3b990b7f327 ("netlabel: fix problems with mapping removal") Signed-off-by: Alex Dewar --- v2: Still print the res field, because it's useful (Paul) net/netlabel/netlabel_domainhash.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/n

Re: [PATCH RFC] netlabel: remove unused param from audit_log_format()

2020-08-27 Thread Alex Dewar
On Thu, Aug 27, 2020 at 06:06:34PM +0100, Alex Dewar wrote: > On Thu, Aug 27, 2020 at 01:00:58PM -0400, Paul Moore wrote: > > On Thu, Aug 27, 2020 at 12:39 PM Alex Dewar wrote: > > > > > > Commit d3b990b7f327 ("netlabel: fix problems with mapping removal") &

Re: [PATCH RFC] netlabel: remove unused param from audit_log_format()

2020-08-27 Thread Alex Dewar
On Thu, Aug 27, 2020 at 01:00:58PM -0400, Paul Moore wrote: > On Thu, Aug 27, 2020 at 12:39 PM Alex Dewar wrote: > > > > Commit d3b990b7f327 ("netlabel: fix problems with mapping removal") > > added a check to return an error if ret_val != 0, before ret_val is >

[PATCH RFC] netlabel: remove unused param from audit_log_format()

2020-08-27 Thread Alex Dewar
ead code") Fixes: d3b990b7f327 ("netlabel: fix problems with mapping removal") Signed-off-by: Alex Dewar --- I wasn't sure whether it was intended that something other than ret_val be printed in the log, so that's why I'm sending this as an RFC. net/netlabel/netlabe

[PATCH] ath11k: return error if firmware request fails

2020-08-25 Thread Alex Dewar
, move the call to memset, as variable bd is not used on all code paths. Fixes: 7b57b2ddec21 ("ath11k: create a common function to request all firmware files") Signed-off-by: Alex Dewar --- drivers/net/wireless/ath/ath11k/qmi.c | 20 +--- 1 file changed, 9 inserti

[PATCH] nfc: st21nfca: Remove unnecessary cast

2020-08-20 Thread Alex Dewar
In st21nfca_connectivity_event_received(), the return value of devm_kzalloc() is unnecessarily cast from void*. Remove cast. Issue identified with Coccinelle. Signed-off-by: Alex Dewar --- drivers/nfc/st21nfca/se.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers

[PATCH] nfc: st-nci: Remove unnecessary cast

2020-08-20 Thread Alex Dewar
In st_nci_hci_connectivity_event_received(), the return value of devm_kzalloc() is unnecessarily cast from void*. Remove cast. Issue identified with Coccinelle. Signed-off-by: Alex Dewar --- drivers/nfc/st-nci/se.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers

[PATCH] net: qed: Remove unnecessary cast

2020-08-20 Thread Alex Dewar
In qed_rdma_destroy_cq() the result of dma_alloc_coherent() is cast from void* unnecessarily. Remove cast. Issue identified with Coccinelle. Signed-off-by: Alex Dewar --- drivers/net/ethernet/qlogic/qed/qed_rdma.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/qlogic

[PATCH] ethernet: cirrus: Remove unused macros

2020-08-18 Thread Alex Dewar
Remove a couple of unused #defines in cs89x0.h. Signed-off-by: Alex Dewar --- drivers/net/ethernet/cirrus/cs89x0.h | 4 1 file changed, 4 deletions(-) diff --git a/drivers/net/ethernet/cirrus/cs89x0.h b/drivers/net/ethernet/cirrus/cs89x0.h index 91423b70bb45..210f9ec9af4b 100644 --- a