milesp20 / intel_nuc_led

Intel NUC7i[x]BN and NUC6CAY LED Control for Linux
GNU General Public License v3.0
89 stars 48 forks source link

memory leak on nuc? #11

Closed ahmebane closed 6 years ago

ahmebane commented 6 years ago

In using the driver (thanks for doing that!), I noticed that if i continuously write to the LED, memory is leaking. Has something to do with vmalloc()/vfree(). If I have the write function immediately return, no memory leak is detected. I then did only vmalloc()/vfree() & then return - memory started leaking. I switched to kmalloc() and kfree() & the issue appears to be gone.

Not sure why vmalloc() is being used, as kmalloc() seems more appropriate. vmalloc() should work, admittedly. I'm not a linux-driver person at all, so I may be offbase.

This is on an Intel NUC6CAYH running Ubuntu 16.04, BIOS version AY00047.

milesp20 commented 6 years ago

Thanks! Memory leak should be corrected now. Leak was in how I was using strsep. I'm not a linux-driver person myself - this is my first adventure into this territory, so bear with me!

ahmebane commented 6 years ago

BTW, this is on an INtel NUC6CAYH running Ubuntu