diff options
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0079-dummy-Add-ndo_uninit.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0079-dummy-Add-ndo_uninit.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0079-dummy-Add-ndo_uninit.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0079-dummy-Add-ndo_uninit.patch new file mode 100644 index 00000000..2a8aa718 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0079-dummy-Add-ndo_uninit.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | From ee79f6838bd3f230ebf00849029dac3b9be112e5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com> | ||
3 | Date: Sun, 15 Apr 2012 13:26:01 +0000 | ||
4 | Subject: [PATCH 079/165] dummy: Add ndo_uninit(). | ||
5 | |||
6 | commit 890fdf2a0cb88202d1427589db2cf29c1bdd3c1d upstream. | ||
7 | |||
8 | In register_netdevice(), when ndo_init() is successful and later | ||
9 | some error occurred, ndo_uninit() will be called. | ||
10 | So dummy deivce is desirable to implement ndo_uninit() method | ||
11 | to free percpu stats for this case. | ||
12 | And, ndo_uninit() is also called along with dev->destructor() when | ||
13 | device is unregistered, so in order to prevent dev->dstats from | ||
14 | being freed twice, dev->destructor is modified to free_netdev(). | ||
15 | |||
16 | Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com> | ||
17 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
18 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
19 | --- | ||
20 | drivers/net/dummy.c | 6 +++--- | ||
21 | 1 files changed, 3 insertions(+), 3 deletions(-) | ||
22 | |||
23 | diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c | ||
24 | index a7c5e88..eeac9ca 100644 | ||
25 | --- a/drivers/net/dummy.c | ||
26 | +++ b/drivers/net/dummy.c | ||
27 | @@ -106,14 +106,14 @@ static int dummy_dev_init(struct net_device *dev) | ||
28 | return 0; | ||
29 | } | ||
30 | |||
31 | -static void dummy_dev_free(struct net_device *dev) | ||
32 | +static void dummy_dev_uninit(struct net_device *dev) | ||
33 | { | ||
34 | free_percpu(dev->dstats); | ||
35 | - free_netdev(dev); | ||
36 | } | ||
37 | |||
38 | static const struct net_device_ops dummy_netdev_ops = { | ||
39 | .ndo_init = dummy_dev_init, | ||
40 | + .ndo_uninit = dummy_dev_uninit, | ||
41 | .ndo_start_xmit = dummy_xmit, | ||
42 | .ndo_validate_addr = eth_validate_addr, | ||
43 | .ndo_set_rx_mode = set_multicast_list, | ||
44 | @@ -127,7 +127,7 @@ static void dummy_setup(struct net_device *dev) | ||
45 | |||
46 | /* Initialize the device structure. */ | ||
47 | dev->netdev_ops = &dummy_netdev_ops; | ||
48 | - dev->destructor = dummy_dev_free; | ||
49 | + dev->destructor = free_netdev; | ||
50 | |||
51 | /* Fill in device structure with ethernet-generic values. */ | ||
52 | dev->tx_queue_len = 0; | ||
53 | -- | ||
54 | 1.7.7.6 | ||
55 | |||