nvethernet: fix coverity defects

CID 9871576 Untrusted array index read
CID 10112340 Dereference before null check
CID 10127838 Unchecked return value
CID 10127841 Dead default in switch
CID 10127905 Unchecked return value
CID 10127961 Unused value

Bug 3461002

Change-Id: If041434e57295b282dacf06ed66b1a436b96a165
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2665776
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mohan Thadikamalla <mohant@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Bhadram Varka
2022-02-08 18:16:06 +05:30
committed by Revanth Kumar Uppala
parent 0bc5754577
commit ad01764abb
6 changed files with 28 additions and 14 deletions

View File

@@ -4996,15 +4996,15 @@ static int ether_get_eqos_clks(struct ether_priv_data *pdata)
goto err_tx;
}
/* This is optional clk */
pdata->rx_m_clk = devm_clk_get(dev, "eqos_rx_m");
if (IS_ERR(pdata->rx_m_clk)) {
ret = PTR_ERR(pdata->rx_m_clk);
dev_info(dev, "failed to get eqos_rx_m clk\n");
}
/* This is optional clk */
pdata->rx_input_clk = devm_clk_get(dev, "eqos_rx_input");
if (IS_ERR(pdata->rx_input_clk)) {
ret = PTR_ERR(pdata->rx_input_clk);
dev_info(dev, "failed to get eqos_rx_input clk\n");
}