]> asedeno.scripts.mit.edu Git - linux.git/commit
IB/rxe: avoid double kfree skb
authorZhu Yanjun <yanjun.zhu@oracle.com>
Thu, 7 Jun 2018 06:32:52 +0000 (02:32 -0400)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 11 Jun 2018 17:02:27 +0000 (11:02 -0600)
commit828d810550abc1fffff9b20545fec4bc150d5e82
tree63af46473c30b6c01fa7b565d44c176ed62a315e
parentc1191a19fecad92b73c25770a7f47174280ca564
IB/rxe: avoid double kfree skb

In rxe_send, when network_type is not RDMA_NETWORK_IPV4 or
RDMA_NETWORK_IPV6, skb is freed and -EINVAL is returned.
Then rxe_xmit_packet will return -EINVAL, too. In rxe_requester,
this skb is double freed.
In rxe_requester, kfree_skb is needed only after fill_packet fails.
So kfree_skb is moved from label err to test fill_packet.

Fixes: 5793b4652155 ("IB/rxe: remove unnecessary skb_clone in xmit")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/sw/rxe/rxe_req.c