freebsd-src/sys/compat/lindebugfs
Bjoern A. Zeeb 5668c22a13 LinuxKPI/lindebugfs: stop panicing in lindebugfs, fix simple_read_from_buffer
Trying to use lindebugfs for debugging wirless drivers two issues
became apparent:
(a) a panic in lindebugfs calling a hard coded release function if the
    caller had not provided one.  This seems to be based on assumptions
    that no longer hold up.  Remove the hard coded release function to
    prevent panics.
(b) In LinuxKPI simple_read_from_buffer() would call copy_to_user() but
    buffers weren't setup for this (lindebugfs copies data from its
    own buffer) and then pseudofs will do another copyout to the user
    on this;  remove the copy_to_user() and simply copy the data over
    to the provided buffer; this works for as long as the only consumers
    remain debugfs callers (which currently seems to be the case).
    [the only out-of-tree consumers I am aware off are two drm-kmod
    drivers/gpu/drm/amd/pm/* debugfs functions I cannot test].

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Tested by:	jfree
Differential Revision: https://reviews.freebsd.org/D45755
2024-07-26 10:53:55 +00:00
..
lindebugfs.c LinuxKPI/lindebugfs: stop panicing in lindebugfs, fix simple_read_from_buffer 2024-07-26 10:53:55 +00:00