[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <552E4B3C.60002@cogentembedded.com>
Date: Wed, 15 Apr 2015 14:27:56 +0300
From: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To: Jeff Kirsher <jeffrey.t.kirsher@...el.com>, davem@...emloft.net
CC: Jesse Brandeburg <jesse.brandeburg@...el.com>,
netdev@...r.kernel.org, nhorman@...hat.com, sassmann@...hat.com,
jogreene@...hat.com
Subject: Re: [net-next 11/14] i40e: handle possible memory allocation failure
Hello.
On 4/15/2015 7:51 AM, Jeff Kirsher wrote:
> From: Jesse Brandeburg <jesse.brandeburg@...el.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.brandeburg@...el.com>
> Tested-by: Jim Young <james.m.young@...el.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@...el.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 majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists