hinic: uninitialized variable in hinic_api_cmd_init()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 24 Aug 2017 10:47:39 +0000 (13:47 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 25 Aug 2017 04:47:11 +0000 (21:47 -0700)
We never set the error code in this function.

Fixes: eabf0fad81d5 ("net-next/hinic: Initialize api cmd resources")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c

index 8901801fe4265eb6b9328c6cf7871551952a7d75..c40603a183df640084cb1da0e1342253598802dc 100644 (file)
@@ -941,6 +941,7 @@ int hinic_api_cmd_init(struct hinic_api_cmd_chain **chain,
                if (IS_ERR(chain[chain_type])) {
                        dev_err(&pdev->dev, "Failed to create chain %d\n",
                                chain_type);
+                       err = PTR_ERR(chain[chain_type]);
                        goto err_create_chain;
                }
        }