aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/irlap_frame.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-12-28 15:49:40 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-12-28 15:49:40 -0500
commit0191b625ca5a46206d2fb862bb08f36f2fcb3b31 (patch)
tree454d1842b1833d976da62abcbd5c47521ebe9bd7 /net/irda/irlap_frame.c
parent54a696bd07c14d3b1192d03ce7269bc59b45209a (diff)
parenteb56092fc168bf5af199d47af50c0d84a96db898 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1429 commits) net: Allow dependancies of FDDI & Tokenring to be modular. igb: Fix build warning when DCA is disabled. net: Fix warning fallout from recent NAPI interface changes. gro: Fix potential use after free sfc: If AN is enabled, always read speed/duplex from the AN advertising bits sfc: When disabling the NIC, close the device rather than unregistering it sfc: SFT9001: Add cable diagnostics sfc: Add support for multiple PHY self-tests sfc: Merge top-level functions for self-tests sfc: Clean up PHY mode management in loopback self-test sfc: Fix unreliable link detection in some loopback modes sfc: Generate unique names for per-NIC workqueues 802.3ad: use standard ethhdr instead of ad_header 802.3ad: generalize out mac address initializer 802.3ad: initialize ports LACPDU from const initializer 802.3ad: remove typedef around ad_system 802.3ad: turn ports is_individual into a bool 802.3ad: turn ports is_enabled into a bool 802.3ad: make ntt bool ixgbe: Fix set_ringparam in ixgbe to use the same memory pools. ... Fixed trivial IPv4/6 address printing conflicts in fs/cifs/connect.c due to the conversion to %pI (in this networking merge) and the addition of doing IPv6 addresses (from the earlier merge of CIFS).
Diffstat (limited to 'net/irda/irlap_frame.c')
-rw-r--r--net/irda/irlap_frame.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c
index f17b65af9c9b..2562ebc1b22c 100644
--- a/net/irda/irlap_frame.c
+++ b/net/irda/irlap_frame.c
@@ -1325,6 +1325,7 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
1325 struct irlap_cb *self; 1325 struct irlap_cb *self;
1326 int command; 1326 int command;
1327 __u8 control; 1327 __u8 control;
1328 int ret = -1;
1328 1329
1329 if (!net_eq(dev_net(dev), &init_net)) 1330 if (!net_eq(dev_net(dev), &init_net))
1330 goto out; 1331 goto out;
@@ -1333,25 +1334,21 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
1333 self = (struct irlap_cb *) dev->atalk_ptr; 1334 self = (struct irlap_cb *) dev->atalk_ptr;
1334 1335
1335 /* If the net device is down, then IrLAP is gone! */ 1336 /* If the net device is down, then IrLAP is gone! */
1336 if (!self || self->magic != LAP_MAGIC) { 1337 if (!self || self->magic != LAP_MAGIC)
1337 dev_kfree_skb(skb); 1338 goto err;
1338 return -1;
1339 }
1340 1339
1341 /* We are no longer an "old" protocol, so we need to handle 1340 /* We are no longer an "old" protocol, so we need to handle
1342 * share and non linear skbs. This should never happen, so 1341 * share and non linear skbs. This should never happen, so
1343 * we don't need to be clever about it. Jean II */ 1342 * we don't need to be clever about it. Jean II */
1344 if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) { 1343 if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) {
1345 IRDA_ERROR("%s: can't clone shared skb!\n", __func__); 1344 IRDA_ERROR("%s: can't clone shared skb!\n", __func__);
1346 dev_kfree_skb(skb); 1345 goto err;
1347 return -1;
1348 } 1346 }
1349 1347
1350 /* Check if frame is large enough for parsing */ 1348 /* Check if frame is large enough for parsing */
1351 if (!pskb_may_pull(skb, 2)) { 1349 if (!pskb_may_pull(skb, 2)) {
1352 IRDA_ERROR("%s: frame too short!\n", __func__); 1350 IRDA_ERROR("%s: frame too short!\n", __func__);
1353 dev_kfree_skb(skb); 1351 goto err;
1354 return -1;
1355 } 1352 }
1356 1353
1357 command = skb->data[0] & CMD_FRAME; 1354 command = skb->data[0] & CMD_FRAME;
@@ -1442,7 +1439,9 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
1442 break; 1439 break;
1443 } 1440 }
1444out: 1441out:
1442 ret = 0;
1443err:
1445 /* Always drop our reference on the skb */ 1444 /* Always drop our reference on the skb */
1446 dev_kfree_skb(skb); 1445 dev_kfree_skb(skb);
1447 return 0; 1446 return ret;
1448} 1447}