Skip to contentSkip to conversation

isdn_net: release resources on failure

PATCH New Arnaldo Carvalho de Melo 1 participant 1 message Jan 4, 2001

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 isdn_net: release resources on failure

Please apply.

- Arnaldo

drivers/isdn/isdn_net.c +5 -1
@@ -19,7 +19,10 @@
  * You should have received a copy of the GNU General Public License
  * 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 <[email protected]>
+ * - release resources on failure in isdn_net_new - 2001/01/03
  */
 
 #include <linux/config.h>
@@ -2325,6 +2328,7 @@
 	memset(netdev, 0, sizeof(isdn_net_dev));
 	if (!(netdev->local = (isdn_net_local *) kmalloc(sizeof(isdn_net_local), GFP_KERNEL))) {
 		printk(KERN_WARNING "isdn_net: Could not allocate device locals\n");
+		kfree(netdev);
 		return NULL;
 	}
 	memset(netdev->local, 0, sizeof(isdn_net_local));

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/