cxgb4: Fix return value check in cfg_queues_uld()
authorWei Yongjun <weiyongjun1@huawei.com>
Sat, 17 Sep 2016 15:52:17 +0000 (15:52 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 19 Sep 2016 05:42:28 +0000 (01:42 -0400)
Fix the retrn value check which testing the wrong variable
in cfg_queues_uld().

Fixes: 94cdb8bb993a ("cxgb4: Add support for dynamic allocation of
resources for ULD")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c

index fc04e3b..d12a73e 100644 (file)
@@ -308,7 +308,7 @@ int cfg_queues_uld(struct adapter *adap, unsigned int uld_type,
        }
 
        rxq_info->rspq_id = kcalloc(nrxq, sizeof(unsigned short), GFP_KERNEL);
-       if (!rxq_info->uldrxq) {
+       if (!rxq_info->rspq_id) {
                kfree(rxq_info->uldrxq);
                kfree(rxq_info);
                return -ENOMEM;