qlcnic: Fix bad kzalloc null test
authorXu Wang <vulab@iscas.ac.cn>
Thu, 26 Mar 2020 10:14:29 +0000 (18:14 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Apr 2020 06:00:24 +0000 (08:00 +0200)
[ Upstream commit bcaeb886ade124331a6f3a5cef34a3f1484c0a03 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c

index 07f9067affc65ea4d73543c18016174217c1971a..cda5b0a9e9489b71c19871c3193332a88127771b 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;