Suggested fix for USB printer (ulpt.c)
Hans Petter Selasky
hselasky at c2i.net
Sun Mar 22 05:55:40 PDT 2009
On Sunday 22 March 2009, debardeleben at aol.com wrote:
> I finally got fed up enough with not being able to print with -CURRENT,
> and found a fix that make ulpt work for me with my epson stylus photo 835.
> I am using cups, and I have always needed to use the non-reset device,
> even with the old USB stack. Hopefully a committer can pick this up and
> include an appropriate version of this fix to the source tree. In the mean
> time, if you are having trouble with a usb printer with -CURRENT, you
> may want to try this patch.
The memory allocated by malloc() when M_ZERO is passed should be all zero, so
the patch you are suggesting is redundant.
dev->softc = malloc(driver->size, M_BUS_SC,
M_NOWAIT | M_ZERO);
So there must be a problem with malloc then, or someone that is using freed
memory! Try compiling a kernel with the INVARIANTS kernel options and perhaps
some malloc debugging.
More information about the freebsd-current