mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
i40e: use common failure flow
As mentioned by Joe Perches, we should be using foo = alloc(...) if (!foo) return -ENOMEM; return 0; Signed-off-by: Jesse Brandeburg <[email protected]> CC: Joe Perches <[email protected]> Tested-by: Kavindya Deegala <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
This commit is contained in:
parent
5aa3a44918
commit
93bc73b827
1 changed files with 6 additions and 6 deletions
|
|
@ -101,10 +101,10 @@ int i40e_allocate_dma_mem_d(struct i40e_hw *hw, struct i40e_dma_mem *mem,
|
|||
mem->size = ALIGN(size, alignment);
|
||||
mem->va = dma_zalloc_coherent(&pf->pdev->dev, mem->size,
|
||||
&mem->pa, GFP_KERNEL);
|
||||
if (mem->va)
|
||||
return 0;
|
||||
if (!mem->va)
|
||||
return -ENOMEM;
|
||||
|
||||
return -ENOMEM;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -136,10 +136,10 @@ int i40e_allocate_virt_mem_d(struct i40e_hw *hw, struct i40e_virt_mem *mem,
|
|||
mem->size = size;
|
||||
mem->va = kzalloc(size, GFP_KERNEL);
|
||||
|
||||
if (mem->va)
|
||||
return 0;
|
||||
if (!mem->va)
|
||||
return -ENOMEM;
|
||||
|
||||
return -ENOMEM;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue