Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tmff2 doesn't compile under vanilla kernel due to unknown function #12

Closed
arabek opened this issue Dec 21, 2020 · 4 comments
Closed

tmff2 doesn't compile under vanilla kernel due to unknown function #12

arabek opened this issue Dec 21, 2020 · 4 comments

Comments

@arabek
Copy link

arabek commented Dec 21, 2020

kzfree(send_buf);

$ make
make -C /lib/modules/5.10.1-gentoo-r1/build M=/usr/src/hid-tmff2 modules
make[1]: Entering directory '/usr/src/linux-5.10.1-gentoo-r1'
  CC [M]  /usr/src/hid-tmff2/hid-tminit.o
/usr/src/hid-tmff2/hid-tminit.c: In function ‘tminit_interrupts’:
/usr/src/hid-tmff2/hid-tminit.c:44:5: error: implicit declaration of function ‘kzfree’; did you mean ‘kfree’? [-Werror=implicit-function-declaration]
   44 |     kzfree(send_buf);
      |     ^~~~~~
      |     kfree
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:279: /usr/src/hid-tmff2/hid-tminit.o] Error 1
make[1]: *** [Makefile:1805: /usr/src/hid-tmff2] Error 2
make[1]: Leaving directory '/usr/src/linux-5.10.1-gentoo-r1'
make: *** [Makefile:5: all] Error 2

I had to manually change that to kfree(send_buf); to make it compile cleanly.
gcc:
gcc version 9.3.0 (Gentoo 9.3.0-r2 p4)

@Kimplul
Copy link
Owner

Kimplul commented Dec 21, 2020

That's interesting. Does adding #include <linux/slab.h> in hid-tmt300rs.h fix the issue?

@berarma
Copy link

berarma commented Dec 21, 2020

kzfree has been renamed to kfree_sensitive. Isn't kfree enough?

@arabek
Copy link
Author

arabek commented Dec 22, 2020

That's interesting. Does adding #include <linux/slab.h> in hid-tmt300rs.h fix the issue?

Nope id didn't. It stil bails, at the same function. Indeed grepping for kzfree in include/linux/slab.h shows up empty in linux kernel source for 5.10 series. Haven't tested on older kernels.

@Kimplul
Copy link
Owner

Kimplul commented Dec 22, 2020

@berarma Good point, no clue what I was thinking using kzfree. Newest commit in master should work, I just changed kzfree to kfree like arabek.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants