Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Mar 2009 13:58:07 +0100
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        freebsd-current@freebsd.org
Cc:        debardeleben@aol.com, freebsd@cfdhome.com
Subject:   Re: Suggested fix for USB printer (ulpt.c)
Message-ID:  <200903221358.08655.hselasky@c2i.net>
In-Reply-To: <8CB78F29832919B-1574-3D1E@WEBMAIL-MY24.sysops.aol.com>
References:  <8CB78F29832919B-1574-3D1E@WEBMAIL-MY24.sysops.aol.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 22 March 2009, debardeleben@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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903221358.08655.hselasky>