Panagiotis Issaris wrote: >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 <[email protected]> >--- > > drivers/net/wireless/ipw2200.c | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) > >8e288419b49346fee512739acac446c951727d04 >diff --git a/drivers/net/wireless/ipw2200.c >b/drivers/net/wireless/ipw2200.c >--- a/drivers/net/wireless/ipw2200.c >+++ b/drivers/net/wireless/ipw2200.c >@@ -3976,6 +3976,10 @@ static struct ipw_rx_queue *ipw_rx_queue > 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)); Please remove the cast and use kzalloc() instead of kmalloc() and memset(,0,). Eike
Attachment:
pgpuhzDboCKzV.pgp
Description: PGP signature
- Follow-Ups:
- Re: [PATCH] ipw2200: Missing kmalloc check
- From: Takis <[email protected]>
- Re: [PATCH] ipw2200: Missing kmalloc check
- Prev by Date: Re: [patch 0/7] Another input update
- Next by Date: Re: 2.6.14-mm1: drivers/pci/hotplug/: namespace clashes
- Previous by thread: Re: [PATCH] ipw2200: Missing kmalloc check
- Next by thread: Re: [PATCH] ipw2200: Missing kmalloc check
- Index(es):