Re: sparse annotation for error types?

2020-12-08 Thread Zhang Changzhong
On 2020/12/8 21:28, Dan Carpenter wrote: > Hi Zhang, > > Are you using Coccinelle to detect these bugs? In fact, I'm not familiar with Coccinelle, these bugs are reported by robot. > > On Sat, Dec 05, 2020 at 02:32:50PM -0800, Jakub Kicinski wrote: >> Hi! >> >> Recently we've been getting a

[PATCH] remoteproc: qcom: Fix potential NULL dereference in adsp_init_mmio()

2020-12-07 Thread Zhang Changzhong
= \(platform_get_resource\|platform_get_resource_byname\)(pdev, t, n); + if (!res) + return -EINVAL; ... when != res == NULL e = devm_ioremap(e1, res->start, e2); Fixes: dc160e449122 ("remoteproc: qcom: Introduce Non-PAS ADSP PIL driver") Signed-off-by: Zhang Changzhong --- drive

[PATCH] slimbus: qcom: fix potential NULL dereference in qcom_slim_prg_slew()

2020-12-07 Thread Zhang Changzhong
, e2; @@ res = \(platform_get_resource\|platform_get_resource_byname\)(pdev, t, n); + if (!res) + return -EINVAL; ... when != res == NULL e = devm_ioremap(e1, res->start, e2); Fixes: ad7fcbc308b0 ("slimbus: qcom: Add Qualcomm Slimbus controller driver") Signed-off-by: Zha

[PATCH net] net: ll_temac: Fix potential NULL dereference in temac_probe()

2020-12-07 Thread Zhang Changzhong
= \(platform_get_resource\|platform_get_resource_byname\)(pdev, t, n); + if (!res) + return -EINVAL; ... when != res == NULL e = devm_ioremap(e1, res->start, e2); Fixes: 8425c41d1ef7 ("net: ll_temac: Extend support to non-device-tree platforms") Signed-off-by: Zhang Changzhong ---

Re: [PATCH net] xsk: Fix error return code in __xp_assign_dev()

2020-12-04 Thread Zhang Changzhong
> > Good catch! My intention here by not setting err is that it should > fall back to copy mode, which it does. The problem is that the > force_zc flag is disregarded when err is not set (see exit code below) > and your patch fixes that. If force_zc is set, we should exit out with > an error, not

[PATCH net v2] xsk: Return error code if force_zc is set

2020-12-04 Thread Zhang Changzhong
If force_zc is set, we should exit out with an error, not fall back to copy mode. Fixes: 921b68692abb ("xsk: Enable sharing of dma mappings") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- net/xdp/xsk_buff_pool.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH net] xsk: Fix error return code in __xp_assign_dev()

2020-12-04 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 921b68692abb ("xsk: Enable sharing of dma mappings") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- net/xdp/xsk_buff_pool.c | 1 + 1 file changed, 1

[PATCH net] net: marvell: prestera: Fix error return code in prestera_port_create()

2020-12-04 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 501ef3066c89 ("net: marvell: prestera: Add driver for Prestera family ASIC devices") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/ne

[PATCH net] net: bridge: vlan: fix error return code in __vlan_add()

2020-12-04 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: f8ed289fab84 ("bridge: vlan: use br_vlan_(get|put)_master to deal with refcounts") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- net/bridge/br_

[PATCH net] ipv4: fix error return code in rtm_to_fib_config()

2020-12-04 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: d15662682db2 ("ipv4: Allow ipv6 gateway with ipv4 routes") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- net/ipv4/fib_frontend.c | 2 +- 1 file

[PATCH wireless] adm8211: fix error return code in adm8211_probe()

2020-12-04 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: cc0b88cf5ecf ("[PATCH] Add adm8211 802.11b wireless driver") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/wireless/admtek/adm8211.c | 6

[PATCH] vhost scsi: fix error return code in vhost_scsi_set_endpoint()

2020-12-04 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 25b98b64e284 ("vhost scsi: alloc cmds per vq instead of session") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/vhost/scsi.c | 3 ++- 1 fi

[PATCH] spi: dw: Fix error return code in dw_spi_bt1_probe()

2020-12-04 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: abf00907538e ("spi: dw: Add Baikal-T1 SPI Controller glue driver") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/spi/spi-dw-bt1.c | 4 ++

[PATCH] rsxx: fix error return code in rsxx_pci_probe()

2020-12-04 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: a3299ab18591 ("rsxx: Individual workqueues for interruptible events.") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/block/rsxx/core.c | 1

[PATCH] PM: AVS: rockchip-io: Fix error return code in rockchip_iodomain_probe()

2020-12-04 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: e943c43b32ce ("PM: AVS: rockchip-io: Move the driver to the rockchip specific drivers") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/soc/r

[PATCH] memory: jz4780_nemc: Fix potential NULL dereference in jz4780_nemc_probe()

2020-12-04 Thread Zhang Changzhong
ource\|platform_get_resource_byname\)(pdev, t, n); + if (!res) + return -EINVAL; ... when != res == NULL e = devm_ioremap(e1, res->start, e2); Fixes: 911a88829725 ("memory: jz4780-nemc: driver for the NEMC on JZ4780 SoCs") Signed-off-by: Zhang Changzhong --- drivers/memory/jz4780-nemc.c | 2 ++

[PATCH] media: smiapp: Fix error return code in smiapp_probe()

2020-12-04 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: de10c1619c48 ("[media] smiapp: Get clock rate if it's not available through DT") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/m

[PATCH] media: mtk-vcodec: fix error return code in vdec_vp9_decode()

2020-12-04 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: dea42fb79f4f ("media: mtk-vcodec: reset segment data then trig decoder") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/media/platform/mtk-v

[PATCH] media: aspeed: fix error return code in aspeed_video_setup_video()

2020-12-04 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: d2b4387f3bdf ("media: platform: Add Aspeed Video Engine driver") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/media/platform/aspeed-v

[PATCH] HID: alps: fix error return code in alps_input_configured()

2020-12-04 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: c7083d3f5348 ("HID: alps: properly handle max_fingers and minimum on X and Y axis") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/hid/hid-

[PATCH] bus: fsl-mc: fix error return code in fsl_mc_object_allocate()

2020-12-04 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 197f4d6a4a00 ("staging: fsl-mc: fsl-mc object allocator driver") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/bus/fsl-mc/fsl-mc-alloc

[PATCH] scsi: fnic: fix error return code in fnic_probe()

2020-12-03 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 5df6d737dd4b ("[SCSI] fnic: Add new Cisco PCI-Express FCoE HBA") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/scsi/fnic/fnic_main.c | 1

[PATCH net] vxlan: fix error return code in __vxlan_dev_create()

2020-12-02 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 0ce1822c2a08 ("vxlan: add adjacent link to limit depth level") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/vxlan.c | 4 +++- 1 file

[PATCH net] net: pasemi: fix error return code in pasemi_mac_open()

2020-12-02 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 72b05b9940f0 ("pasemi_mac: RX/TX ring management cleanup") Fixes: 8d636d8bc5ff ("pasemi_mac: jumbo frame support") Reported-by: Hulk Robot Signed-off-

[PATCH net] cxgb3: fix error return code in t3_sge_alloc_qset()

2020-12-02 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: b1fb1f280d09 ("cxgb3 - Fix dma mapping error path") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/chelsio/cxgb3/sge.c | 1

[PATCH net] bnxt_en: fix error return code in bnxt_init_board()

2020-11-19 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 1

[PATCH] pwm: add missed clk_disable_unprepare() in zx_pwm_probe()

2020-11-18 Thread Zhang Changzhong
Add the missing clk_disable_unprepare() before return from zx_pwm_probe() in the error handling case. Fixes: 4836193c435c ("pwm: Add ZTE ZX PWM device driver") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/pwm/pwm-zx.c | 1 + 1 file changed, 1 insertion(+) di

[PATCH net] bnxt_en: fix error return code in bnxt_init_one()

2020-11-18 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: c213eae8d3cd ("bnxt_en: Improve VF/PF link change logic.") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/broadcom/bnxt/bnxt.

Re: [PATCH net] atl1e: fix error return code in atl1e_probe()

2020-11-17 Thread Zhang Changzhong
On 2020/11/18 4:38, Marion & Christophe JAILLET wrote: > > Le 17/11/2020 à 03:57, Zhang Changzhong a écrit : >> Fix to return a negative error code from the error handling >> case instead of 0, as done elsewhere in this function. >> >> Fixes: 85eb5bc33717 (&q

[PATCH net] rsi_91x: fix error return code in rsi_reset_card()

2020-11-16 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 17ff2c794f39 ("rsi: reset device changes for 9116") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/wireless/rsi/rsi_91x_

[PATCH net] net: b44: fix error return code in b44_init_one()

2020-11-16 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 39a6f4bce6b4 ("b44: replace the ssb_dma API with the generic DMA API") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/broadcom

[PATCH net] atl1e: fix error return code in atl1e_probe()

2020-11-16 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 85eb5bc33717 ("net: atheros: switch from 'pci_' to 'dma_' API") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ether

[PATCH net] atl1c: fix error return code in atl1c_probe()

2020-11-16 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 85eb5bc33717 ("net: atheros: switch from 'pci_' to 'dma_' API") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ether

[PATCH net] ah6: fix error return code in ah6_input()

2020-11-16 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- net/ipv6/ah6.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletio

[PATCH net] qed: fix error return code in qed_iwarp_ll2_start()

2020-11-16 Thread Zhang Changzhong
a fpdus") Fixes: 1e28eaad07ea ("qed: Add iWARP support for fpdu spanned over more than two tcp packets") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/qlogic/qed/qed_iwarp.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/d

[PATCH net] net: ethernet: ti: cpsw: fix error return code in cpsw_probe()

2020-11-12 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 83a8471ba255 ("net: ethernet: ti: cpsw: refactor probe to group common hw initialization") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/ne

[PATCH] IB/hfi1: fix error return code in hfi1_init_dd()

2020-11-12 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 4730f4a6c6b2 ("IB/hfi1: Activate the dummy netdev") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/infiniband/hw/hfi1/chip.c | 3 ++- 1 file

[PATCH net] net: stmmac: dwmac-intel-plat: fix error return code in intel_eth_plat_probe()

2020-11-12 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 9efc9b2b04c7 ("net: stmmac: Add dwmac-intel-plat for GBE driver") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/stmicro/st

[PATCH] brcmfmac: fix error return code in brcmf_cfg80211_connect()

2020-11-12 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 3b1e0a7bdfee ("brcmfmac: add support for SAE authentication offload") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/wireless/broadcom

[PATCH net] qlcnic: fix error return code in qlcnic_83xx_restart_hw()

2020-11-12 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 3ced0a88cd4c ("qlcnic: Add support to run firmware POST") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/qlogic/qlcnic/qlcnic_8

[PATCH net] cx82310_eth: fix error return code in cx82310_bind()

2020-11-12 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: ca139d76b0d9 ("cx82310_eth: re-enable ethernet mode after router reboot") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/usb/cx82310

Re: [PATCH net] net: dsa: lantiq_gswip: add missed clk_disable_unprepare() in gswip_gphy_fw_load()

2020-11-12 Thread Zhang Changzhong
On 2020/11/12 20:41, Vladimir Oltean wrote: > > gswip_gphy_fw_list > -> gswip_gphy_fw_probe >-> gswip_gphy_fw_load > -> clk_prepare_enable > -> then fails > > Then gswip_gphy_fw_list does this: > for_each_available_child_of_node(gphy_fw_list_np, gphy_fw_np) { >

[PATCH net] iavf: fix error return code in iavf_init_get_resources()

2020-11-12 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: b66c7bc1cd4d ("iavf: Refactor init state machine") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/intel/iavf/iavf_main.c | 3 +

[PATCH net] net: ethernet: mtk-star-emac: fix error return code in mtk_star_enable()

2020-11-12 Thread Zhang Changzhong
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 8c7bd5a454ff ("net: ethernet: mtk-star-emac: new driver") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/mediatek/mtk_star_emac.

[PATCH net] net: phy: smsc: add missed clk_disable_unprepare in smsc_phy_probe()

2020-11-12 Thread Zhang Changzhong
Add the missing clk_disable_unprepare() before return from smsc_phy_probe() in the error handling case. Fixes: bedd8d78aba3 ("net: phy: smsc: LAN8710/20: add phy refclk in support") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/phy/smsc.c | 4 +++- 1 file

[PATCH net] net: dsa: lantiq_gswip: add missed clk_disable_unprepare() in gswip_gphy_fw_load()

2020-11-12 Thread Zhang Changzhong
Fix missing clk_disable_unprepare() before return from gswip_gphy_fw_load() in the error handling case. Fixes: 14fceff4771e ("net: dsa: Add Lantiq / Intel DSA driver for vrx200") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/dsa/lantiq_gswip.c | 6

[PATCH net-next] net: mventa: remove unused variable 'dummy' in mvneta_mib_counters_clear()

2020-09-18 Thread Zhang Changzhong
t to avoid build warning. Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/marvell/mvneta.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index f75e05e..4694242 100644 --- a/drivers/ne

[PATCH v2] brcmfmac: check return value of driver_for_each_device()

2020-09-18 Thread Zhang Changzhong
the return value should be checked. Signed-off-by: Zhang Changzhong --- v2: - cc linux-wireless --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom

[PATCH net-next] net: brcmfmac: check return value of driver_for_each_device()

2020-09-18 Thread Zhang Changzhong
the return value should be checked. Signed-off-by: Zhang Changzhong --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c ind

[PATCH net-next] net: qlcnic: remove unused variable 'val' in qlcnic_83xx_cam_unlock()

2020-09-14 Thread Zhang Changzhong
access routines"), variable 'val' is never used in qlcnic_83xx_cam_unlock(), so removing it to avoid build warning. Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) dif

[PATCH net-next] net: pxa168_eth: remove unused variable 'retval' int pxa168_eth_change_mtu()

2020-09-14 Thread Zhang Changzhong
#x27;retval' is redundant, just remove it. Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/marvell/pxa168_eth.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168

[PATCH net-next] net: fec: ptp: remove unused variable 'ns' in fec_time_keep()

2020-09-14 Thread Zhang Changzhong
quot;), variable 'ns' is never used in fec_time_keep(), so removing it to avoid build warning. Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/freescale/fec_ptp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/

[PATCH net-next] net: dnet: remove unused variable 'tx_status 'in dnet_start_xmit()

2020-09-14 Thread Zhang Changzhong
driver (updated)"), variable 'tx_status' is never used in dnet_start_xmit(), so removing it to avoid build warning. Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/dnet.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net

[PATCH net-next] net: stmmac: dwmac-intel-plat: remove redundant null check before clk_disable_unprepare()

2020-09-09 Thread Zhang Changzhong
Because clk_prepare_enable() and clk_disable_unprepare() already checked NULL clock parameter, so the additional checks are unnecessary, just remove them. Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c | 8 ++-- 1 file

[PATCH net-next] net: pxa168_eth: remove redundant null check before clk_disable_unprepare()

2020-09-09 Thread Zhang Changzhong
Because clk_prepare_enable() and clk_disable_unprepare() already checked NULL clock parameter, so the additional checks are unnecessary, just remove them. Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/marvell/pxa168_eth.c | 4 +--- 1 file changed, 1 insertion

[PATCH net-next] net: xilinx: remove redundant null check before clk_disable_unprepare()

2020-09-07 Thread Zhang Changzhong
Because clk_prepare_enable() and clk_disable_unprepare() already checked NULL clock parameter, so the additional checks are unnecessary, just remove them. Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 3 +-- 1 file changed, 1

[PATCH net-next] net: stmmac: remove redundant null check before clk_disable_unprepare()

2020-09-07 Thread Zhang Changzhong
Because clk_prepare_enable() and clk_disable_unprepare() already checked NULL clock parameter, so the additional checks are unnecessary, just remove them. Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ++ 1 file changed, 2

[PATCH net-next] net: ethernet: fec: remove redundant null check before clk_disable_unprepare()

2020-09-07 Thread Zhang Changzhong
Because clk_prepare_enable() and clk_disable_unprepare() already checked NULL clock parameter, so the additional checks are unnecessary, just remove them. Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/freescale/fec_main.c | 3 +-- 1 file changed, 1 insertion

[PATCH net-next] net: ethernet: dwmac: remove redundant null check before clk_disable_unprepare()

2020-09-07 Thread Zhang Changzhong
Because clk_prepare_enable() and clk_disable_unprepare() already checked NULL clock parameter, so the additional checks are unnecessary, just remove them. Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 3 +-- 1 file changed, 1

[PATCH net] can: j1939: j1939_sk_bind(): return failure if netdev is down

2020-09-06 Thread Zhang Changzhong
support of SAE J1939 protocol") Signed-off-by: Zhang Changzhong --- net/can/j1939/socket.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/can/j1939/socket.c b/net/can/j1939/socket.c index 1be4c89..f239665 100644 --- a/net/can/j1939/socket.c +++ b/net/can/j1939/socket.c @@ -4

Re: [PATCH net 0/4] support multipacket broadcast message

2020-08-07 Thread Zhang Changzhong
vcan1: sudo cangw -A -s vcan0 -d vcan1 -e sudo cangw -A -s vcan1 -d vcan0 -e To reproduce it use following commands: testj1939 -B -r vcan1:0x90 & testj1939 -B -s20 vcan0:0x80 :,0x12300 Besides, candump receives correct packets while testj1939 receives nothing. Regards, Zhang Changzhong On 2

[PATCH net 2/4] can: j1939: cancel rxtimer on multipacket broadcast session complete

2020-08-04 Thread Zhang Changzhong
If j1939_xtp_rx_dat_one() receive last frame of multipacket broadcast message, j1939_session_timers_cancel() should be called to cancel rxtimer. Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol") Signed-off-by: Zhang Changzhong --- net/can/j1939/transport.c | 1 + 1 file

[PATCH net 4/4] can: j1939: add rxtimer for multipacket broadcast session

2020-08-04 Thread Zhang Changzhong
timeout will occur when a time of greater than 750 ms elapsed between two message packets when more packets were expected. So this patch fix and add rxtimer for multipacket broadcast session. Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol") Signed-off-by: Zhang Changzhong --

[PATCH net 3/4] can: j1939: abort multipacket broadcast session when timeout occurs

2020-08-04 Thread Zhang Changzhong
s called to start new rxtimer again and again. So fix it by moving session->state = J1939_SESSION_WAITING_ABORT out of if (!j1939_cb_is_broadcast(&session->skcb)) statement. Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol") Signed-off-by: Zhang Changzhong ---

[PATCH net 0/4] support multipacket broadcast message

2020-08-04 Thread Zhang Changzhong
Zhang Changzhong (4): can: j1939: fix support for multipacket broadcast message can: j1939: cancel rxtimer on multipacket broadcast session complete can: j1939: abort multipacket broadcast session when timeout occurs can: j1939: add rxtimer for multipacket broadcast session net/can/j1939

[PATCH net 1/4] can: j1939: fix support for multipacket broadcast message

2020-08-04 Thread Zhang Changzhong
, j1939_tp_cmd_recv() and j1939_xtp_rx_dat() didn't process broadcast message. So fix it by checking and process broadcast message in j1939_tp_recv(), j1939_tp_cmd_recv() and j1939_xtp_rx_dat(). Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol") Signed-off-by: Zhang Changzhon

[PATCH net-next] net: fs_enet: remove redundant null check

2020-07-20 Thread Zhang Changzhong
Because clk_prepare_enable and clk_disable_unprepare already checked NULL clock parameter, so the additional checks are unnecessary, just remove them. Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 6 ++ 1 file changed, 2 insertions(+), 4

[PATCH net] net: bcmgenet: add missed clk_disable_unprepare in bcmgenet_probe

2020-07-20 Thread Zhang Changzhong
The driver forgets to call clk_disable_unprepare() in error path after a success calling for clk_prepare_enable(). Fix to goto err_clk_disable if clk_prepare_enable() is successful. Fixes: c80d36ff63a5 ("net: bcmgenet: Use devm_clk_get_optional() to get the clocks") Signed-off

[PATCH net] net: bcmgenet: fix error returns in bcmgenet_probe()

2020-07-20 Thread Zhang Changzhong
The driver forgets to call clk_disable_unprepare() in error path after a success calling for clk_prepare_enable(). Fix to goto err_clk_disable if clk_prepare_enable() is successful. Fixes: c80d36ff63a5 ("net: bcmgenet: Use devm_clk_get_optional() to get the clocks") Signed-off

[PATCH net] net: bcmgenet: fix error returns in bcmgenet_probe()

2020-07-20 Thread Zhang Changzhong
The driver forgets to call clk_disable_unprepare() in error path after a success calling for clk_prepare_enable(). Fix to goto err_clk_disable if clk_prepare_enable() is successful. Fixes: 99d55638d4b0 ("net: bcmgenet: enable NETIF_F_HIGHDMA flag") Signed-off-by: Zhang Changzhong --

[PATCH net-next] net: ethernet: et131x: Remove unused variable 'pm_csr'

2020-07-17 Thread Zhang Changzhong
t ethernet driver et131x to drivers/net"), 'pm_csr' is never used in these functions, so removing it to avoid build warning. Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/agere/et131x.c | 10 +++--- 1 file changed, 3 insertions(+), 7 del

[PATCH net-next] net: bna: Remove unused variable 't'

2020-07-17 Thread Zhang Changzhong
so removing it to avoid build warning. Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/brocade/bna/bfa_ioc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/brocade/bna/bfa_ioc.c b/drivers/net/ethernet/brocade/bna/bf

[PATCH net-next] net: bcmgenet: fix error returns in bcmgenet_probe()

2020-07-17 Thread Zhang Changzhong
The driver forgets to call clk_disable_unprepare() in error path after a success calling for clk_prepare_enable(). Fix to goto err_clk_disable if clk_prepare_enable() is successful. Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 6 +++--- 1 file changed, 3

[PATCH net-next v2] can: ti_hecc: add missed clk_disable_unprepare() in error path

2020-07-17 Thread Zhang Changzhong
The driver forgets to call clk_disable_unprepare() in error path after a success calling for clk_prepare_enable(). Fix it by adding a clk_disable_unprepare() in error path. Signed-off-by: Zhang Changzhong --- drivers/net/can/ti_hecc.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions

[PATCH net-next] can: mscan: simplify clock enable/disable

2020-07-17 Thread Zhang Changzhong
All the NULL checks are pointless, clk_*() routines already deal with NULL just fine. Signed-off-by: Zhang Changzhong --- drivers/net/can/mscan/mscan.c | 28 ++-- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/drivers/net/can/mscan/mscan.c b/drivers/net

[PATCH net-next] can: silence remove_proc_entry warning

2020-07-13 Thread Zhang Changzhong
exists. Signed-off-by: Zhang Changzhong --- net/can/proc.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/can/proc.c b/net/can/proc.c index e6881bf..077af42 100644 --- a/net/can/proc.c +++ b/net/can/proc.c @@ -471,6 +471,9 @@ void can_init_proc(struct net *net