]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
Bluetooth: 6lowpan: Fix double kfree of netdev priv
authorGlenn Ruben Bakke <glenn.ruben.bakke@nordicsemi.no>
Wed, 17 Jun 2015 14:32:26 +0000 (07:32 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 17 Jun 2015 17:17:58 +0000 (19:17 +0200)
This patch removes the kfree of the netdev priv in device_event() upon
NETDEV_UNREGISTER event. The freeing of memory is taken care of by the
netdev destructor.

Signed-off-by: Lukasz Duda <lukasz.duda@nordicsemi.no>
Signed-off-by: Glenn Ruben Bakke <glenn.ruben.bakke@nordicsemi.no>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/6lowpan.c

index bc105a91c84acc4c9856bbbac5c9aeb51e782750..071f9eb3805d8bce33a9686a2e544df0e8a65508 100644 (file)
@@ -928,7 +928,7 @@ static void delete_netdev(struct work_struct *work)
 
        unregister_netdev(entry->netdev);
 
-       /* The entry pointer is deleted in device_event() */
+       /* The entry pointer is deleted by the netdev destructor. */
 }
 
 static void chan_close_cb(struct l2cap_chan *chan)
@@ -1418,7 +1418,6 @@ static int device_event(struct notifier_block *unused,
                                BT_DBG("Unregistered netdev %s %p",
                                       netdev->name, netdev);
                                list_del(&entry->list);
-                               kfree(entry);
                                break;
                        }
                }