Skip to content

Commit

Permalink
ipwireless: don't oops if we run out of space
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Nov 16, 2012
1 parent 4bd8213 commit d1519e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/tty/ipwireless/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ static struct sk_buff *ipw_packet_received_skb(unsigned char *data,
}

skb = dev_alloc_skb(length + 4);
if (skb == NULL)
return NULL;
skb_reserve(skb, 2);
memcpy(skb_put(skb, length), data, length);

Expand Down Expand Up @@ -397,7 +399,8 @@ void ipwireless_network_packet_received(struct ipw_network *network,

/* Send the data to the ppp_generic module. */
skb = ipw_packet_received_skb(data, length);
ppp_input(network->ppp_channel, skb);
if (skb)
ppp_input(network->ppp_channel, skb);
} else
spin_unlock_irqrestore(&network->lock,
flags);
Expand Down

0 comments on commit d1519e2

Please sign in to comment.