Hi, you fail to free minors if something goes wrong in probe.
Regards Oliver You can import this changeset into BK by piping this whole message to: '| bk receive [path to repository]' or apply the patch as usual. =================================================================== [EMAIL PROTECTED], 2002-05-05 12:49:55+02:00, [EMAIL PROTECTED] fix a failure to free a minor in the error path of probe diff -Nru a/drivers/usb/class/printer.c b/drivers/usb/class/printer.c --- a/drivers/usb/class/printer.c Sun May 5 12:56:39 2002 +++ b/drivers/usb/class/printer.c Sun May 5 12:56:39 2002 @@ -820,7 +820,7 @@ usblp->minor++; if (usblp->minor >= USBLP_MINORS) { err("no more free usblp devices"); - goto abort; + goto abort_minor; } } } @@ -828,12 +828,12 @@ usblp->writeurb = usb_alloc_urb(0, GFP_KERNEL); if (!usblp->writeurb) { err("out of memory"); - goto abort; + goto abort_minor; } usblp->readurb = usb_alloc_urb(0, GFP_KERNEL); if (!usblp->readurb) { err("out of memory"); - goto abort; + goto abort_minor; } /* Malloc device ID string buffer to the largest expected length, @@ -841,7 +841,7 @@ * could change in length. */ if (!(usblp->device_id_string = kmalloc(DEVICE_ID_SIZE, GFP_KERNEL))) { err("out of memory for device_id_string"); - goto abort; + goto abort_minor; } /* Malloc write/read buffers in one chunk. We somewhat wastefully @@ -849,7 +849,7 @@ * alternate setting can be changed later via an ioctl. */ if (!(usblp->buf = kmalloc(2 * USBLP_BUF_SIZE, GFP_KERNEL))) { err("out of memory for buf"); - goto abort; + goto abort_minor; } /* Lookup quirks for this printer. */ @@ -863,12 +863,12 @@ dbg("incompatible printer-class device 0x%4.4X/0x%4.4X", dev->descriptor.idVendor, dev->descriptor.idProduct); - goto abort; + goto abort_minor; } /* Setup the selected alternate setting and endpoints. */ if (usblp_set_protocol(usblp, protocol) < 0) - goto abort; + goto abort_minor; /* Retrieve and store the device ID string. */ usblp_cache_device_id_string(usblp); @@ -897,6 +897,8 @@ return usblp; +abort_minor: + usb_deregister_dev (&usblp_driver, 1, usblp->minor); abort: if (usblp) { usb_free_urb(usblp->writeurb); =================================================================== This BitKeeper patch contains the following changesets: 1.518 ## Wrapped with gzip_uu ## begin 664 bkpatch11371 M'XL(`.</U3P``\U4;6O;,!#^'/V*@\+8:&WKQ98MEY1L[=C*!@L9_1QL1XZ] M.%:0[:P;_O%39&B6D81N_3(A..GNN=/IT8,NX*&1.AZIJMQ*C2[@HVI:LY6U MJJ5;J+6LRKI[=)5>FN!,*1/T=FYOR/#2E=-J*1NO:U*'N@$RL&G29@68:!./ MB,N>/.V/C8Q'L_<?'CZ_G2$T'L-MD=1+^56V,!ZC=#59=+)R5UHEQ>[$_BG< M4XP)(33`+.`DZ&G$F-\3CM.%62YH*/*4"[15WUJ9%9.F:Z2;_3S,I]ADDXCR M`/=$A$*@.R!N0"+`U,.!F4!H[(LX""XQC3&&X8J38V3`)0$'HW?P\J9O409Y M^0@)Y$E9=5I"JR`WG!K/NJR5AK*&MI`@M3:;3=(6H'+8:)5*]`DH(8*BZ9Y* MY/SE0`@G&-T<N<I"[PBP;^MM=%FW4KO9_EH^%H3WC/I4]&F>X$@P$?I)CEF6 MGR/OH&Y6)4US6'WW4@'!_JXZQX)2JY4S2<?5\X+NT5++Y60HE:GU<QIF)"0" M^[U94=]*BX9_*HOPYRA+@!/^#\H:J/\"COYNIU'*]-PK_(/P[B+*@*#[P8S, M6"K38Y(JW<YMB]<&PXC%6',"P0<$/XGP?8NPYC@BH!9AS7$$'T[AIT\)AT[# M4YW>1T(`1;_Y8C0R5,X7T@BN;`R/9KF%UZ^,L]K,![:O@%R!=3@W-NG-]?Z; 7S0J9K9IN/98X]$7$,/H%;6KZ\]0%```` ` end _______________________________________________________________ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel