OSDN Git Service

NFC: Fix a memory leak
authorJulien Lefrique <lefrique@marvell.com>
Tue, 21 Oct 2014 14:52:50 +0000 (16:52 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 28 Nov 2014 13:07:51 +0000 (14:07 +0100)
Signed-off-by: Julien Lefrique <lefrique@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
net/nfc/llcp_core.c

index 51e7887..b18f07c 100644 (file)
@@ -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);