summaryrefslogtreecommitdiff
path: root/net/nfc/llcp_core.c
diff options
context:
space:
mode:
authorJulien Lefrique <lefrique@marvell.com>2014-10-21 18:52:50 +0400
committerSamuel Ortiz <sameo@linux.intel.com>2014-11-28 16:07:51 +0300
commit966efbfb0dc06bc90131ea41aa4be67c0d22853d (patch)
tree748d8af3ff5f6800aeed9b98a848f63ef382e89c /net/nfc/llcp_core.c
parent122c195872e963c83f3a61dcab0937247b56786e (diff)
downloadlinux-966efbfb0dc06bc90131ea41aa4be67c0d22853d.tar.xz
NFC: Fix a memory leak
Signed-off-by: Julien Lefrique <lefrique@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/llcp_core.c')
-rw-r--r--net/nfc/llcp_core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/nfc/llcp_core.c b/net/nfc/llcp_core.c
index 51e788797317..b18f07ccb504 100644
--- a/net/nfc/llcp_core.c
+++ b/net/nfc/llcp_core.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2011 Intel Corporation. All rights reserved.
+ * Copyright (C) 2014 Marvell International Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1511,8 +1512,10 @@ int nfc_llcp_data_received(struct nfc_dev *dev, struct sk_buff *skb)
struct nfc_llcp_local *local;
local = nfc_llcp_find_local(dev);
- if (local == NULL)
+ if (local == NULL) {
+ kfree_skb(skb);
return -ENODEV;
+ }
__nfc_llcp_recv(local, skb);