When prism2_hw_config() fails, we just return an error code
without any resource release, which may lead to memleak.
Signed-off-by: Dinghao Liu
---
drivers/net/wireless/intersil/hostap/hostap_cs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless
> On Sun, Feb 28, 2021 at 08:25:22PM +0800, Dinghao Liu wrote:
> > There is one il_set_tx_power() call in this function without
> > return value check. Print error message and return error code
> > on failure just like the other il_set_tx_power() call.
>
> We have fe
There is one il_set_tx_power() call in this function without
return value check. Print error message and return error code
on failure just like the other il_set_tx_power() call.
Signed-off-by: Dinghao Liu
---
drivers/net/wireless/intel/iwlegacy/4965.c | 6 +-
1 file changed, 5 insertions
When vsi->type == I40E_VSI_FDIR, we have caught the return value of
i40e_vsi_request_irq() but without further handling. Check and execute
memory clean on failure just like the other i40e_vsi_request_irq().
Fixes: 8a9eb7d3cbcab ("i40e: rework fdir setup and teardown")
Signed-off-by
There is one e1e_wphy() call in e1000_set_d0_lplu_state_82571
that we have caught its return value but lack further handling.
Check and terminate the execution flow just like other e1e_wphy()
in this function.
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/intel/e1000e/82571.c | 2 ++
1
When register_pernet_subsys() fails, nf_nat_bysource
should be freed just like when nf_ct_extend_register()
fails.
Fixes: 1cd472bf036ca ("netfilter: nf_nat: add nat hook register functions to
nf_nat")
Signed-off-by: Dinghao Liu
---
net/netfilter/nf_nat_core.c | 1 +
1 file changed, 1
> On Wed, 6 Jan 2021 18:56:23 +0800 (GMT+08:00) dinghao@zju.edu.cn
> wrote:
> > > I used this one for a test:
> > >
> > > https://patchwork.kernel.org/project/netdevbpf/patch/1609312994-121032-1-git-send-email-abaci-bug...@linux.alibaba.com/
> > >
> > > I'm not getting the Fixes tag when I do
> On Mon, 28 Dec 2020 16:14:17 -0500 Konstantin Ryabitsev wrote:
> > On Mon, Dec 28, 2020 at 01:05:26PM -0800, Florian Fainelli wrote:
> > > On 12/28/2020 12:23 PM, Konstantin Ryabitsev wrote:
> > > > On Thu, Dec 24, 2020 at 01:57:40PM -0800, Florian Fainelli wrote:
> > > Konstantin, would
> Dear Dinghao,
>
>
> Am 03.01.21 um 09:08 schrieb Dinghao Liu:
> > When ixgbe_fdir_write_perfect_filter_82599() fails,
> > input allocated by kzalloc() has not been freed,
> > which leads to memleak.
>
> Nice find. Thank you for your patches. Out of curiosit
When ixgbe_fdir_write_perfect_filter_82599() fails,
input allocated by kzalloc() has not been freed,
which leads to memleak.
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net
ter
kfree() to avoid double free.
Fixes: 7b3722fa9ef64 ("net/mlx5e: Support RSS for GRE tunneled packets")
Fixes: 33cfaaa8f36ff ("net/mlx5e: Split the main flow steering table")
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Set ft->g to NULL after kfree() instead of remov
> On Mon, Dec 21, 2020 at 04:50:31PM +0800, Dinghao Liu wrote:
> > mlx5e_create_ttc_table_groups() frees ft->g on failure of
> > kvzalloc(), but such failure will be caught by its caller
> > in mlx5e_create_ttc_table() and ft->g will be freed again
> > in mlx5e_des
> On Wed, 23 Dec 2020 20:38:33 +0800 Dinghao Liu wrote:
> > The error handling paths in enic_alloc_vnic_resources()
> > have called enic_free_vnic_resources() before returning.
> > So we may not need to call it again on failure at caller
> > side.
> >
> > Si
The error handling paths in enic_alloc_vnic_resources()
have called enic_free_vnic_resources() before returning.
So we may not need to call it again on failure at caller
side.
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/cisco/enic/enic_ethtool.c | 1 -
1 file changed, 1 deletion
When mdiobus_register() fails, priv->mdio allocated
by mdiobus_alloc() has not been freed, which leads
to memleak.
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/ethoc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ethoc.c b/drivers/
When mlx5_create_flow_group() fails, ft->g should be
freed just like when kvzalloc() fails. The caller of
mlx5e_create_l2_table_groups() does not catch this
issue on failure, which leads to memleak.
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 1 +
1 f
mlx5e_create_ttc_table_groups() frees ft->g on failure of
kvzalloc(), but such failure will be caught by its caller
in mlx5e_create_ttc_table() and ft->g will be freed again
in mlx5e_destroy_flow_table(). The same issue also occurs
in mlx5e_create_ttc_table_groups().
Signed-off-by: Dingh
When mvneta_port_power_up() fails, we should execute
cleanup functions after label err_netdev to avoid memleak.
Fixes: 41c2b6b4f0f80 ("net: ethernet: mvneta: Add back interface mode
validation")
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/marvell/mvneta.c | 2 +-
1 file
When rtnl_configure_link() fails, peer needs to be
freed just like when register_netdevice() fails.
Signed-off-by: Dinghao Liu
---
drivers/net/veth.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 8c737668008a..6c68094399cc 100644
--- a
>
> On 21.10.20 07:21, Dinghao Liu wrote:
> > When rtnl_configure_link() fails, peer needs to be
> > freed just like when register_netdevice() fails.
> >
> > Signed-off-by: Dinghao Liu
>
> Acked-by: Oliver Hartkopp
>
> Btw. as the vxcan.c driver b
When rtnl_configure_link() fails, peer needs to be
freed just like when register_netdevice() fails.
Signed-off-by: Dinghao Liu
---
drivers/net/can/vxcan.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/can/vxcan.c b/drivers/net/can/vxcan.c
index d6ba9426be4d..aefc5a61d239
When kmalloc() fails, cipher should be freed
just like when krb5_rc4_setup_seq_key() fails.
Fixes: e7afe6c1d486b ("sunrpc: fix 4 more call sites that were using stack
memory with a scatterlist")
Signed-off-by: Dinghao Liu
---
net/sunrpc/auth_gss/gss_krb5_seqnum.c | 6 --
1 file
When kcalloc() on rx_rings fails, we should free tx_rings
and xdp_rings to prevent memleak. Similarly, when
ice_alloc_rx_bufs() fails, we should free xdp_rings.
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/intel/ice/ice_ethtool.c | 13 +++--
1 file changed, 11 insertions(+), 2
When kmalloc() on ticket fails, response should be freed
to prevent memleak.
Signed-off-by: Dinghao Liu
---
net/rxrpc/rxkad.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c
index 52a24d4ef5d8..e08130e5746b 100644
--- a/net/rxrpc
When devm_kcalloc() fails, dev should be freed just
like what we've done in the subsequent error paths.
Fixes: 7b78be48a8eb6 ("net: systemport: Dynamically allocate number of TX
rings")
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/broadcom/bcmsysport.c | 6 --
1
hns_nic_dev_probe allocates ndev, but not free it on
two error handling paths, which may lead to memleak.
Fixes: 63434888aaf1b ("net: hns: net: hns: enet adds support of acpi")
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/hisilicon/hns/hns_enet.c | 9 ++---
1 file
When make_rate() fails, vcc should be freed just
like other error paths in fs_open().
Signed-off-by: Dinghao Liu
---
drivers/atm/firestream.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index 2ca9ec802734..510250cf5c87 100644
--- a
When devm_gpiod_get_optional() fails, bus should be
freed just like when of_mdiobus_register() fails.
Fixes: 1bddd96cba03d ("net: arc_emac: support the phy reset for emac driver")
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/arc/emac_mdio.c | 1 +
1 file changed, 1 insertio
When down_killable() fails, skb_resp should be freed
just like when st95hf_spi_send() fails.
Signed-off-by: Dinghao Liu
---
drivers/nfc/st95hf/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c
index 9642971e89ce
When devm_clk_get() returns -EPROBE_DEFER, spi_priv
should be freed just like when wilc_cfg80211_init()
fails.
Fixes: 854d66df74aed ("staging: wilc1000: look for rtc_clk clock in spi mode")
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Remove 'staging' prefix in subje
When devm_clk_get() returns -EPROBE_DEFER, sdio_priv
should be freed just like when wilc_cfg80211_init()
fails.
Fixes: 8692b047e86cf ("staging: wilc1000: look for rtc_clk clock")
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Remove 'staging' prefix in subject.
---
ajay.kat...@microchip.com写道:
> Thanks for submitting the patch. The code changes looks okay to me.
>
> The driver is now moved out of staging so 'staging' prefix is not
> required in subject. For future patches on wilc driver, the 'staging'
> prefix can be removed.
>
> For this patch, I am not
When devm_clk_get() returns -EPROBE_DEFER, spi_priv
should be freed just like when wilc_cfg80211_init()
fails.
Fixes: 854d66df74aed ("staging: wilc1000: look for rtc_clk clock in spi mode")
Signed-off-by: Dinghao Liu
---
drivers/net/wireless/microchip/wilc1000/spi.c | 5 +++--
1 file
When devm_clk_get() returns -EPROBE_DEFER, sdio_priv
should be freed just like when wilc_cfg80211_init()
fails.
Fixes: 8692b047e86cf ("staging: wilc1000: look for rtc_clk clock")
Signed-off-by: Dinghao Liu
---
drivers/net/wireless/microchip/wilc1000/sdio.c | 5 +++--
1 file
> From: Dinghao Liu
> Date: Fri, 24 Jul 2020 16:06:57 +0800
>
> > If req->ctype does not match any of NIX_AQ_CTYPE_CQ,
> > NIX_AQ_CTYPE_SQ or NIX_AQ_CTYPE_RQ, pointer bmap will remain
> > uninitialized and be accessed in test_bit(), which can lead
> > to kern
If req->ctype does not match any of NIX_AQ_CTYPE_CQ,
NIX_AQ_CTYPE_SQ or NIX_AQ_CTYPE_RQ, pointer bmap will remain
uninitialized and be accessed in test_bit(), which can lead
to kernal crash.
Fix this by returning an error code if this case is triggered.
Signed-off-by: Dinghao Liu
---
driv
Remove runtime PM usage counter decrement when the
increment function has not been called to keep the
counter balanced.
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/smsc/smsc911x.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/smsc
When register_flexcandev() returns an error code, a
pairing runtime PM usage counter decrement is needed
to keep the counter balanced.
Also, call pm_runtime_disable() when register_flexcandev()
returns an error code.
Signed-off-by: Dinghao Liu
---
drivers/net/can/flexcan.c | 2 ++
1 file
When wlcore_fw_status() returns an error code, a pairing
runtime PM usage counter decrement is needed to keep the
counter balanced. It's the same for all error paths after
wlcore_fw_status().
Signed-off-by: Dinghao Liu
---
drivers/net/wireless/ti/wlcore/main.c | 17 +
1
There is a check against ret after out_sleep tag. If
wl1271_configure_suspend_ap()
returns an error code, ret will be caught by this check and a warning will be
issued.
"Tony Lindgren" <t...@atomide.com>写道:
> * Dinghao Liu [200520 12:58]:
> > When wlcore_hw_interrupt_
When wl12xx_cmd_role_disable() returns an error code,
a pairing runtime PM usage counter decrement is needed to
keep the counter balanced.
Signed-off-by: Dinghao Liu
---
drivers/net/wireless/ti/wlcore/main.c | 8 ++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net
When wlcore_hw_interrupt_notify() returns an error code,
a pairing runtime PM usage counter decrement is needed to
keep the counter balanced.
Signed-off-by: Dinghao Liu
---
drivers/net/wireless/ti/wlcore/main.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
drivers/net/wireless/ti/wlcore/main.c | 4 +++-
1 file changed, 3
There are two error handling paths in this functon. When
wlcore_tx_work_locked() returns an error code, we should
decrease the runtime PM usage counter the same way as the
error handling path beginning from pm_runtime_get_sync().
Signed-off-by: Dinghao Liu
---
drivers/net/wireless/ti/wlcore
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
drivers/net/can/xilinx_can.c | 2 +-
1 file changed, 1 insertion(+), 1
45 matches
Mail list logo