From: Dan Carpenter Date: Thu, 24 Aug 2017 10:47:39 +0000 (+0300) Subject: hinic: uninitialized variable in hinic_api_cmd_init() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=256fbe111218ccc3de4aff1aab44c9b08cd06c92;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git hinic: uninitialized variable in hinic_api_cmd_init() We never set the error code in this function. Fixes: eabf0fad81d5 ("net-next/hinic: Initialize api cmd resources") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c index 8901801fe426..c40603a183df 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c @@ -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; } }