Re: Suggested fix for USB printer (ulpt.c)

From: Hans Petter Selasky <hselasky_at_c2i.net>
Date: Sun, 22 Mar 2009 13:58:07 +0100
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.

Hi,

The memory allocated by malloc() when M_ZERO is passed should be all zero, so 
the patch you are suggesting is redundant.

See "device_set_driver()":

                        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.

--HPS
Received on Sun Mar 22 2009 - 11:55:40 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:44 UTC