Skip to content

Commit

Permalink
[PATCH] ipw2200: Missing kmalloc check
Browse files Browse the repository at this point in the history
The ipw2200 driver code in current GIT contains a kmalloc() followed by
a memset() without handling a possible memory allocation failure.

Signed-off-by: Panagiotis Issaris <panagiotis.issaris@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
  • Loading branch information
Panagiotis Issaris authored and Jeff Garzik committed Oct 28, 2005
1 parent 4f07570 commit ad18b0e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/wireless/ipw2200.c
Original file line number Diff line number Diff line change
Expand Up @@ -4030,6 +4030,10 @@ static struct ipw_rx_queue *ipw_rx_queue_alloc(struct ipw_priv *priv)
int i;

rxq = (struct ipw_rx_queue *)kmalloc(sizeof(*rxq), GFP_KERNEL);
if (unlikely(!rxq)) {
IPW_ERROR("memory allocation failed\n");
return NULL;
}
memset(rxq, 0, sizeof(*rxq));
spin_lock_init(&rxq->lock);
INIT_LIST_HEAD(&rxq->rx_free);
Expand Down

0 comments on commit ad18b0e

Please sign in to comment.