[mpf70-devel] Re: MpMan driver
Status: Inactive
Brought to you by:
jeremy_laine
From: Jeremy <jer...@po...> - 2003-10-18 22:21:57
|
Hi! I'm not sure what you describe is accurate, there would already be problems in a single device situation upon disconnecting/reconnecting. If you look at mpf70.h you'll see that currently, the "list of devices" only allows for one device (MPF70_MAX =3D 1). If indeed I am writing s->usbdev =3D NULL in the wrong place, reconnecting the device work should cause a failure (mpf70_find_struct would not find an entry with a NULL usbdev). This is not the observed behaviour! Jeremy -- =20 http://www.jerryweb.org/ : JerryWeb.org http://sailcut.sourceforge.net/ : Sailcut CAD http://mpf70.sourceforge.net/ : MPman MP-F70 support for Linux On Sat, 18 Oct 2003 15:59:32 +0200 (CEST) Kiss Karoly wrote: > Hello, >=20 > The mailing list is OK with me. I just subscribed to it. > In my e-mail what I meant was that it's ok that you try to set the > s->usbdev =3D NULL; > but that never happens because you are in the wrong place in memory. > So if later you try to view what devices you have attached in your > static block of devices one of your pointers will not be NULL ( > which you intended it to be ) and you would violate the rule you > described to me in your letter earlyer. >=20 > > "After returning from the disconnect function the USB framework > > completly deallocates all data structures associated with this > > device. So especially the usb_device structure must not be used > > any longer by the usb driver." >=20 > This means that you still have a pointer to the usb_device structure > in your list of devices. >=20 > Regards > Kiss Karoly >=20 > On Sat, 18 Oct 2003, Jeremy [ISO-8859-1] Lain=E9 wrote: >=20 > > Hello Anthony, > > > > Kiss Karoly (cc of this email) has been looking throught the mpf70 > > driver code as he is interested in producing a kernel module for > > the mpf50. I thought maybe you'd be interested in joining the > > discussion:) > > > > If it's ok with both of you maybe we can switch to : > > mpf...@li... > > > > .. so there is a trace of all this! > > > > Regards, > > Jeremy > > > > -- > > http://www.jerryweb.org/ : JerryWeb.org > > http://sailcut.sourceforge.net/ : Sailcut CAD > > http://mpf70.sourceforge.net/ : MPman MP-F70 support for Linux > > > > --- > > Date: Sat, 18 Oct 2003 12:15:10 +0200 (CEST) > > From: Kiss Karoly > > To: Jeremy Lain=E9 > > Subject: MpMan driver > > > > > > Hello Jeremy, > > > > I noticed a little bug in your mpf70 driver, it's probably not a > > big thing > > but anyways I think you should know. > > In your mpf70_disconnect function you typecast the void *ptr to > > mpf70_t > > type and set the usbdev in it to NULL. That is wrong because that > > pointer > > contains a pointer to an integer containing the address of the usb > > device > > on the bus. > > It probably does nothing important but if you try to handle more > > than one > > device with your driver you will notice that it does not free the > > appropriate resource. Not to mention that you could write a NULL > > value somewhere you shouldn't. > > > > Regards > > Kiss Karoly > > |