LCDproc development and user support list

Text archives Help

[Lcdproc] PATCH: Memory leak in PicoLCD driver

Chronological Thread 
  • From: peter at (Peter Marschall)
  • Subject: [Lcdproc] PATCH: Memory leak in PicoLCD driver
  • Date: Wed, 17 Sep 2008 08:41:55 +0200


please keep replies to the list.

On Tuesday, 16. September 2008, you wrote:
> Peter Marschall wrote:
> > On Monday, 1. September 2008, Jack Cleaver wrote:
> >> I'm offering the attached patch for the picoLCD driver.
> >>
> >> [ ... ]
> >
> > retval is only used on initialization, and on assignment from keystr.
> > It is not returned either. What is it good for ?
> As I said, my C is rusty, so perhaps I have misunderstood you. However
> it seems clear to me that retval is indeed returned, at the last
> statement in the function. It returns a pointer to the value from the
> key_matrix that had been assigned to keystr.
> > With your solution the function returns NULL all the time indicating
> > that no key was pressed. I guess this is not what you intended.
> If I insert a debug line immediately before the return statement
> (conditional on retval not being NULL), then press the Up button, it
> shows that "Up" is being returned.

Oops, I overlook the final "return retval" line in your original patch.
(The classical diff output format is really hard to read)

but even then, I think it only adds a variable that is used for the same
purpose as keystr.

That's why I prefer to leave this patch out.


> My true concern, however, has been to add to the driver the ability to
> decode IR events and pass them to LIRC, because this device uses a
> single USB channel for the keypad and the IR sensor. As a consequence,
> it seems that only one piece of code can "own" the device at one time.
> It follows that if is loaded, then either it sends IR codes
> to LIRC, or the sensor is effectively disabled.
> I have written the IR sensor code, and I am using it successfully; but I
> wanted to get this memory leak out of the way as a separate patch,
> before submitting the IR sensor patch. The keystroke-queueing problem
> isn't within the scope of the itch I am scratching.

I will respond to your patch in a separate mail.


Peter Marschall
peter at

Archive powered by MHonArc 2.6.18.

Top of page