diff mbox

[PATCHv2,net-next,16/31] iw_cxgb4: don't leak skb in c4iw_uld_rx_handler().

Message ID 1393828875-13452-17-git-send-email-hariprasad@chelsio.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Hariprasad Shenai March 3, 2014, 6:41 a.m. UTC
From: Steve Wise <swise@opengridcomputing.com>

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
 drivers/infiniband/hw/cxgb4/device.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Comments

Sergei Shtylyov March 3, 2014, 6:46 p.m. UTC | #1
Hello.

On 03/03/2014 09:41 AM, Hariprasad Shenai wrote:

> From: Steve Wise <swise@opengridcomputing.com>

> Signed-off-by: Steve Wise <swise@opengridcomputing.com>
> ---
>   drivers/infiniband/hw/cxgb4/device.c |    4 +++-
>   1 files changed, 3 insertions(+), 1 deletions(-)

> diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
> index 9542ccc..f73fea4 100644
> --- a/drivers/infiniband/hw/cxgb4/device.c
> +++ b/drivers/infiniband/hw/cxgb4/device.c
> @@ -936,9 +936,11 @@ static int c4iw_uld_rx_handler(void *handle, const __be64 *rsp,
>   	opcode = *(u8 *)rsp;
>   	if (c4iw_handlers[opcode])
>   		c4iw_handlers[opcode](dev, skb);
> -	else
> +	else {
>   		pr_info("%s no handler opcode 0x%x...\n", __func__,
>   		       opcode);
> +		kfree_skb(skb);
> +	}

    Should have {} in both arms of the *if* statement now. See 
Documentation/CodingStyle.

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" 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/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
index 9542ccc..f73fea4 100644
--- a/drivers/infiniband/hw/cxgb4/device.c
+++ b/drivers/infiniband/hw/cxgb4/device.c
@@ -936,9 +936,11 @@  static int c4iw_uld_rx_handler(void *handle, const __be64 *rsp,
 	opcode = *(u8 *)rsp;
 	if (c4iw_handlers[opcode])
 		c4iw_handlers[opcode](dev, skb);
-	else
+	else {
 		pr_info("%s no handler opcode 0x%x...\n", __func__,
 		       opcode);
+		kfree_skb(skb);
+	}
 
 	return 0;
 nomem: