diff options
| author | Ying Xue <ying.xue@windriver.com> | 2014-01-14 21:23:43 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-01-14 21:50:47 -0500 |
| commit | a74e9426948cce451af0433c69a120178948cb03 (patch) | |
| tree | ff913e11bda927f62166dbb7afd55202abca3710 /net/caif | |
| parent | 16b77695ed8fa158be864ee448a9ef4c78457c14 (diff) | |
caif: __dev_get_by_index instead of dev_get_by_index to find interface
The following call chains indicate that chnl_net_open() is under
rtnl_lock protection as __dev_open() is protected by rtnl_lock.
So if __dev_get_by_index() instead of dev_get_by_index() is used
to find interface handler in it, this would help us avoid to change
interface reference counter.
__dev_open()
chnl_net_open()
Cc: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/caif')
| -rw-r--r-- | net/caif/chnl_net.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/caif/chnl_net.c b/net/caif/chnl_net.c index 7344a8fa1bb0..4589ff67bfa9 100644 --- a/net/caif/chnl_net.c +++ b/net/caif/chnl_net.c | |||
| @@ -285,7 +285,7 @@ static int chnl_net_open(struct net_device *dev) | |||
| 285 | goto error; | 285 | goto error; |
| 286 | } | 286 | } |
| 287 | 287 | ||
| 288 | lldev = dev_get_by_index(dev_net(dev), llifindex); | 288 | lldev = __dev_get_by_index(dev_net(dev), llifindex); |
| 289 | 289 | ||
| 290 | if (lldev == NULL) { | 290 | if (lldev == NULL) { |
| 291 | pr_debug("no interface?\n"); | 291 | pr_debug("no interface?\n"); |
| @@ -307,7 +307,6 @@ static int chnl_net_open(struct net_device *dev) | |||
| 307 | mtu = min_t(int, dev->mtu, lldev->mtu - (headroom + tailroom)); | 307 | mtu = min_t(int, dev->mtu, lldev->mtu - (headroom + tailroom)); |
| 308 | mtu = min_t(int, GPRS_PDP_MTU, mtu); | 308 | mtu = min_t(int, GPRS_PDP_MTU, mtu); |
| 309 | dev_set_mtu(dev, mtu); | 309 | dev_set_mtu(dev, mtu); |
| 310 | dev_put(lldev); | ||
| 311 | 310 | ||
| 312 | if (mtu < 100) { | 311 | if (mtu < 100) { |
| 313 | pr_warn("CAIF Interface MTU too small (%d)\n", mtu); | 312 | pr_warn("CAIF Interface MTU too small (%d)\n", mtu); |
