diff mbox

[rdma-next,4/4] IB/sa: Use nlmsg_free instead of kfree_skb

Message ID 1462340165-16067-5-git-send-email-leon@kernel.org (mailing list archive)
State Superseded
Headers show

Commit Message

Leon Romanovsky May 4, 2016, 5:36 a.m. UTC
From: Mark Bloch <markb@mellanox.com>

Fixes a direct call to kfree_skb when nlmsg_free should be used.

Fixes: 2ca546b92a02 ('IB/sa: Route SA pathrecord query through netlink')
Signed-off-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
---
 drivers/infiniband/core/sa_query.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steve Wise May 4, 2016, 3:42 p.m. UTC | #1
> -----Original Message-----
> From: linux-rdma-owner@vger.kernel.org [mailto:linux-rdma-
> owner@vger.kernel.org] On Behalf Of Leon Romanovsky
> Sent: Wednesday, May 04, 2016 12:36 AM
> To: dledford@redhat.com
> Cc: linux-rdma@vger.kernel.org; markb@mellanox.com; majd@mellanox.com;
> matanb@mellanox.com; Leon Romanovsky
> Subject: [PATCH rdma-next 4/4] IB/sa: Use nlmsg_free instead of kfree_skb
> 
> From: Mark Bloch <markb@mellanox.com>
> 
> Fixes a direct call to kfree_skb when nlmsg_free should be used.
> 
> Fixes: 2ca546b92a02 ('IB/sa: Route SA pathrecord query through netlink')
> Signed-off-by: Mark Bloch <markb@mellanox.com>
> Signed-off-by: Leon Romanovsky <leon@kernel.org>
> ---
>  drivers/infiniband/core/sa_query.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/core/sa_query.c
b/drivers/infiniband/core/sa_query.c
> index 24c2aac..5050c61 100644
> --- a/drivers/infiniband/core/sa_query.c
> +++ b/drivers/infiniband/core/sa_query.c
> @@ -536,7 +536,7 @@ static int ib_nl_send_msg(struct ib_sa_query *query, gfp_t
> gfp_mask)
>  	data = ibnl_put_msg(skb, &nlh, query->seq, 0, RDMA_NL_LS,
>  			    RDMA_NL_LS_OP_RESOLVE, NLM_F_REQUEST);
>  	if (!data) {
> -		kfree_skb(skb);
> +		nlmsg_free(skb);
>  		return -EMSGSIZE;
>  	}
> 

Looks good.

Reviewed-by: Steve Wise <swise@opengridcomputing.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ira Weiny May 4, 2016, 9:38 p.m. UTC | #2
On Wed, May 04, 2016 at 08:36:05AM +0300, Leon Romanovsky wrote:
> From: Mark Bloch <markb@mellanox.com>
> 
> Fixes a direct call to kfree_skb when nlmsg_free should be used.
> 
> Fixes: 2ca546b92a02 ('IB/sa: Route SA pathrecord query through netlink')
> Signed-off-by: Mark Bloch <markb@mellanox.com>
> Signed-off-by: Leon Romanovsky <leon@kernel.org>

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

> ---
>  drivers/infiniband/core/sa_query.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c
> index 24c2aac..5050c61 100644
> --- a/drivers/infiniband/core/sa_query.c
> +++ b/drivers/infiniband/core/sa_query.c
> @@ -536,7 +536,7 @@ static int ib_nl_send_msg(struct ib_sa_query *query, gfp_t gfp_mask)
>  	data = ibnl_put_msg(skb, &nlh, query->seq, 0, RDMA_NL_LS,
>  			    RDMA_NL_LS_OP_RESOLVE, NLM_F_REQUEST);
>  	if (!data) {
> -		kfree_skb(skb);
> +		nlmsg_free(skb);
>  		return -EMSGSIZE;
>  	}
>  
> -- 
> 2.1.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c
index 24c2aac..5050c61 100644
--- a/drivers/infiniband/core/sa_query.c
+++ b/drivers/infiniband/core/sa_query.c
@@ -536,7 +536,7 @@  static int ib_nl_send_msg(struct ib_sa_query *query, gfp_t gfp_mask)
 	data = ibnl_put_msg(skb, &nlh, query->seq, 0, RDMA_NL_LS,
 			    RDMA_NL_LS_OP_RESOLVE, NLM_F_REQUEST);
 	if (!data) {
-		kfree_skb(skb);
+		nlmsg_free(skb);
 		return -EMSGSIZE;
 	}