lkml.org 
[lkml]   [2000]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] drivers/char/epca.c: release resources on failure
Hi,

Please take a look and consider applying.

- Arnaldo

--- linux-2.4.0-test7-pre3/drivers/char/epca.c Fri Jul 28 06:34:41 2000
+++ linux-2.4.0-test7-pre3.acme/drivers/char/epca.c Sun Aug 13 09:50:09 2000
@@ -24,6 +24,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

+ Changes:
+ Arnaldo Carvalho de Melo <acme@conectiva.com.br> - 08/14/2000
+ - release previously allocated resources on failure in post_fep_init
+
--------------------------------------------------------------------------- */
/* See README.epca for change history --DAT*/

@@ -2187,15 +2191,17 @@
ch->blocked_open = 0;
ch->callout_termios = pc_callout.init_termios;
ch->normal_termios = pc_driver.init_termios;
- init_waitqueue_head(&ch->open_wait);
- init_waitqueue_head(&ch->close_wait);
ch->tmp_buf = kmalloc(ch->txbufsize,GFP_KERNEL);
- if (!(ch->tmp_buf))
- {
+ if (!ch->tmp_buf) {
printk(KERN_ERR "POST FEP INIT : kmalloc failed for port 0x%x\n",i);
+ while(--i >= 0)
+ kfree(card_ptr[crd + i]->tmp_buf);
+ return;

}
memset((void *)ch->tmp_buf,0,ch->txbufsize);
+ init_waitqueue_head(&ch->open_wait);
+ init_waitqueue_head(&ch->close_wait);
} /* End for each port */

printk(KERN_INFO
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:58    [from the cache]
©2003-2011 Jasper Spaans