提交 d1519e23 编写于 作者: A Alan Cox 提交者: Greg Kroah-Hartman

ipwireless: don't oops if we run out of space

Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=49851Signed-off-by: NAlan Cox <alan@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 4bd82136
...@@ -352,6 +352,8 @@ static struct sk_buff *ipw_packet_received_skb(unsigned char *data, ...@@ -352,6 +352,8 @@ static struct sk_buff *ipw_packet_received_skb(unsigned char *data,
} }
skb = dev_alloc_skb(length + 4); skb = dev_alloc_skb(length + 4);
if (skb == NULL)
return NULL;
skb_reserve(skb, 2); skb_reserve(skb, 2);
memcpy(skb_put(skb, length), data, length); memcpy(skb_put(skb, length), data, length);
...@@ -397,7 +399,8 @@ void ipwireless_network_packet_received(struct ipw_network *network, ...@@ -397,7 +399,8 @@ void ipwireless_network_packet_received(struct ipw_network *network,
/* Send the data to the ppp_generic module. */ /* Send the data to the ppp_generic module. */
skb = ipw_packet_received_skb(data, length); skb = ipw_packet_received_skb(data, length);
ppp_input(network->ppp_channel, skb); if (skb)
ppp_input(network->ppp_channel, skb);
} else } else
spin_unlock_irqrestore(&network->lock, spin_unlock_irqrestore(&network->lock,
flags); flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册