Commit 26f91da2 authored by zhong jiang's avatar zhong jiang Committed by Doug Ledford

RDMA/cxgb4: remove redundant null pointer check before kfree_skb

kfree_skb has taken the null pointer into account. hence it is safe
to remove the redundant null pointer check before kfree_skb.
Signed-off-by: default avatarzhong jiang <zhongjiang@huawei.com>
Acked-by: default avatarSteve Wise <swise@opengridcomputing.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent fa8f1158
...@@ -403,8 +403,7 @@ void _c4iw_free_ep(struct kref *kref) ...@@ -403,8 +403,7 @@ void _c4iw_free_ep(struct kref *kref)
ep->com.local_addr.ss_family); ep->com.local_addr.ss_family);
dst_release(ep->dst); dst_release(ep->dst);
cxgb4_l2t_release(ep->l2t); cxgb4_l2t_release(ep->l2t);
if (ep->mpa_skb) kfree_skb(ep->mpa_skb);
kfree_skb(ep->mpa_skb);
} }
if (!skb_queue_empty(&ep->com.ep_skb_list)) if (!skb_queue_empty(&ep->com.ep_skb_list))
skb_queue_purge(&ep->com.ep_skb_list); skb_queue_purge(&ep->com.ep_skb_list);
......
...@@ -2813,8 +2813,7 @@ struct ib_srq *c4iw_create_srq(struct ib_pd *pd, struct ib_srq_init_attr *attrs, ...@@ -2813,8 +2813,7 @@ struct ib_srq *c4iw_create_srq(struct ib_pd *pd, struct ib_srq_init_attr *attrs,
free_srq_queue(srq, ucontext ? &ucontext->uctx : &rhp->rdev.uctx, free_srq_queue(srq, ucontext ? &ucontext->uctx : &rhp->rdev.uctx,
srq->wr_waitp); srq->wr_waitp);
err_free_skb: err_free_skb:
if (srq->destroy_skb) kfree_skb(srq->destroy_skb);
kfree_skb(srq->destroy_skb);
err_free_srq_idx: err_free_srq_idx:
c4iw_free_srq_idx(&rhp->rdev, srq->idx); c4iw_free_srq_idx(&rhp->rdev, srq->idx);
err_free_wr_wait: err_free_wr_wait:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment