diff options
author | Insu Yun <wuninsu@gmail.com> | 2015-10-19 16:57:10 +0000 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-10-21 16:41:19 -0400 |
commit | fe274c5aed1b5e311e0e83306572b70312c0313a (patch) | |
tree | 393dd2630ce412b115271c3ba454609816633535 /drivers/infiniband/hw | |
parent | 35ef4a9ebfe3392da8ca025c8c16365c9da472e5 (diff) | |
download | linux-fe274c5aed1b5e311e0e83306572b70312c0313a.tar.gz linux-fe274c5aed1b5e311e0e83306572b70312c0313a.tar.bz2 linux-fe274c5aed1b5e311e0e83306572b70312c0313a.zip |
usnic: correctly handle kzalloc return value
Since kzalloc returns memory address, not error code,
it should be checked whether it is null or not.
Signed-off-by: Insu Yun <wuninsu@gmail.com>
Reviewed-by: Dave Goodell <dgoodell@cisco.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r-- | drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c index 85dc3f989ff7..fcea3a24d3eb 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c @@ -236,8 +236,8 @@ create_roce_custom_flow(struct usnic_ib_qp_grp *qp_grp, /* Create Flow Handle */ qp_flow = kzalloc(sizeof(*qp_flow), GFP_ATOMIC); - if (IS_ERR_OR_NULL(qp_flow)) { - err = qp_flow ? PTR_ERR(qp_flow) : -ENOMEM; + if (!qp_flow) { + err = -ENOMEM; goto out_dealloc_flow; } qp_flow->flow = flow; @@ -311,8 +311,8 @@ create_udp_flow(struct usnic_ib_qp_grp *qp_grp, /* Create qp_flow */ qp_flow = kzalloc(sizeof(*qp_flow), GFP_ATOMIC); - if (IS_ERR_OR_NULL(qp_flow)) { - err = qp_flow ? PTR_ERR(qp_flow) : -ENOMEM; + if (!qp_flow) { + err = -ENOMEM; goto out_dealloc_flow; } qp_flow->flow = flow; |