Hello.

On 4/15/2015 7:51 AM, Jeff Kirsher wrote:

From: Jesse Brandeburg <jesse.brandeb...@intel.com>

The init_interrupt_scheme function had a possible failure
path to allocate memory that was found by smatch.

This adds the correct handling to the function to abort
probe if the memory allocation fails.

Change-ID: I2bf1d826a244209619da4c452d0d58b3eb5e26a3
Signed-off-by: Jesse Brandeburg <jesse.brandeb...@intel.com>
Tested-by: Jim Young <james.m.yo...@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirs...@intel.com>
---
  drivers/net/ethernet/intel/i40e/i40e_main.c | 14 +++++++++++---
  1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c 
b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 63de3f4..b297294 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
[...]
@@ -7343,11 +7343,17 @@ static void i40e_init_interrupt_scheme(struct i40e_pf 
*pf)
        /* set up vector assignment tracking */
        size = sizeof(struct i40e_lump_tracking) + (sizeof(u16) * vectors);
        pf->irq_pile = kzalloc(size, GFP_KERNEL);
+       if (!pf->irq_pile) {
+               dev_err(&pf->pdev->dev, "error allocating irq_pile memory\n");

No need for error message, a call trace will be printed on failed allocation anyway.

[...]

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to