aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2012-11-01 12:45:49 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-15 19:53:15 -0500
commitd1519e23c2b3a518fb41daf3eceae43382433ceb (patch)
tree7ac7d32367f964801d4b63296025867fd775b987 /drivers/tty
parent4bd82136cdf04f3a8d50e20c1b76da750f75f2db (diff)
ipwireless: don't oops if we run out of space
Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=49851 Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/ipwireless/network.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/tty/ipwireless/network.c b/drivers/tty/ipwireless/network.c
index 57102e66165a..c0dfb642383b 100644
--- a/drivers/tty/ipwireless/network.c
+++ b/drivers/tty/ipwireless/network.c
@@ -352,6 +352,8 @@ static struct sk_buff *ipw_packet_received_skb(unsigned char *data,
352 } 352 }
353 353
354 skb = dev_alloc_skb(length + 4); 354 skb = dev_alloc_skb(length + 4);
355 if (skb == NULL)
356 return NULL;
355 skb_reserve(skb, 2); 357 skb_reserve(skb, 2);
356 memcpy(skb_put(skb, length), data, length); 358 memcpy(skb_put(skb, length), data, length);
357 359
@@ -397,7 +399,8 @@ void ipwireless_network_packet_received(struct ipw_network *network,
397 399
398 /* Send the data to the ppp_generic module. */ 400 /* Send the data to the ppp_generic module. */
399 skb = ipw_packet_received_skb(data, length); 401 skb = ipw_packet_received_skb(data, length);
400 ppp_input(network->ppp_channel, skb); 402 if (skb)
403 ppp_input(network->ppp_channel, skb);
401 } else 404 } else
402 spin_unlock_irqrestore(&network->lock, 405 spin_unlock_irqrestore(&network->lock,
403 flags); 406 flags);