OSDN Git Service

qlcnic: Fix bad kzalloc null test
authorXu Wang <vulab@iscas.ac.cn>
Thu, 26 Mar 2020 10:14:29 +0000 (18:14 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 26 Mar 2020 18:44:22 +0000 (11:44 -0700)
In qlcnic_83xx_get_reset_instruction_template, the variable
of null test is bad, so correct it.

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c

index 07f9067..cda5b0a 100644 (file)
@@ -1720,7 +1720,7 @@ static int qlcnic_83xx_get_reset_instruction_template(struct qlcnic_adapter *p_d
 
        ahw->reset.seq_error = 0;
        ahw->reset.buff = kzalloc(QLC_83XX_RESTART_TEMPLATE_SIZE, GFP_KERNEL);
-       if (p_dev->ahw->reset.buff == NULL)
+       if (ahw->reset.buff == NULL)
                return -ENOMEM;
 
        p_buff = p_dev->ahw->reset.buff;