patch-1.3.25 linux/drivers/net/ewrk3.c

Next file: linux/drivers/net/ibmtr.c
Previous file: linux/drivers/net/eql.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.24/linux/drivers/net/ewrk3.c linux/drivers/net/ewrk3.c
@@ -548,6 +548,8 @@
 	      /* private area & initialise */
 	      dev->priv = (void *) kmalloc(sizeof(struct ewrk3_private), 
 					                           GFP_KERNEL);
+	      if (dev->priv == NULL)
+		  return -ENOMEM;
 	      lp = (struct ewrk3_private *)dev->priv;
 	      memset(dev->priv, 0, sizeof(struct ewrk3_private));
 	      lp->shmem_base = mem_start;
@@ -1883,6 +1885,8 @@
   } else {
     release_region(thisEthwrk.base_addr, EWRK3_TOTAL_SIZE);
     unregister_netdev(&thisEthwrk);
+    free(thisEthwrk.priv);
+    thisEthwrk.priv = NULL;
   }
 }
 #endif /* MODULE */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this