[PATCH] ipw2200: Missing kmalloc check
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>
This commit is contained in:
parent
4f075707a9
commit
ad18b0ea08
1 changed files with 4 additions and 0 deletions
|
@ -4030,6 +4030,10 @@ static struct ipw_rx_queue *ipw_rx_queue_alloc(struct ipw_priv *priv)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
rxq = (struct ipw_rx_queue *)kmalloc(sizeof(*rxq), GFP_KERNEL);
|
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));
|
memset(rxq, 0, sizeof(*rxq));
|
||||||
spin_lock_init(&rxq->lock);
|
spin_lock_init(&rxq->lock);
|
||||||
INIT_LIST_HEAD(&rxq->rx_free);
|
INIT_LIST_HEAD(&rxq->rx_free);
|
||||||
|
|
Loading…
Reference in a new issue