mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
net: hns3: remove an unnecessary 'goto' in hclge_init_ae_dev()
Remove the redundant 'goto' and return -ENOMEM directly, when allocating memory for 'hdev' fails in hclge_init_ae_dev(). Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f4b992b461
commit
2421ee2477
1 changed files with 2 additions and 4 deletions
|
@ -9928,10 +9928,8 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
|
|||
int ret;
|
||||
|
||||
hdev = devm_kzalloc(&pdev->dev, sizeof(*hdev), GFP_KERNEL);
|
||||
if (!hdev) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
if (!hdev)
|
||||
return -ENOMEM;
|
||||
|
||||
hdev->pdev = pdev;
|
||||
hdev->ae_dev = ae_dev;
|
||||
|
|
Loading…
Reference in a new issue