mirror of
https://github.com/sysprog21/lkmpg.git
synced 2024-11-22 08:10:48 +08:00
6b6b6635cf
Smatch[1][2] is a pluggable static analysis for C. It may help us find out the potential problem of the example code. Doing with smatch, if set the --file-output flag, it will generate the {}.c.smatch report for each c file. This will make a little bit complicated to collect all the report messages. So, here we stay at the default setting, stdout for the smatch messages. For more information, see: - https://lwn.net/Articles/696624/ - https://elinux.org/images/d/d3/Bargmann.pdf Also, fix the warning from Smatch: Smatch failed: 1 warning(s), 1 error(s) lkmpg/examples/procfs2.c:57 procfile_write() error: buffer overflow 'procfs_buffer' 1024 <= 1024 lkmpg/examples/kbleds.c:58 kbleds_init() warn: argument 5 to %lx specifier is cast from pointer Furthermore, the effect of the write operation in procfs2.c is too implied. So after writing, print the buffer every time. Close #122 [1] https://github.com/error27/smatch [2] https://repo.or.cz/w/smatch.git |
||
---|---|---|
.. | ||
other | ||
.clang-format | ||
bottomhalf.c | ||
chardev.c | ||
chardev.h | ||
chardev2.c | ||
completions.c | ||
cryptosha256.c | ||
cryptosk.c | ||
devicemodel.c | ||
example_atomic.c | ||
example_mutex.c | ||
example_rwlock.c | ||
example_spinlock.c | ||
example_tasklet.c | ||
hello-1.c | ||
hello-2.c | ||
hello-3.c | ||
hello-4.c | ||
hello-5.c | ||
hello-sysfs.c | ||
intrpt.c | ||
ioctl.c | ||
kbleds.c | ||
Makefile | ||
print_string.c | ||
procfs1.c | ||
procfs2.c | ||
procfs3.c | ||
procfs4.c | ||
sched.c | ||
sleep.c | ||
start.c | ||
stop.c | ||
syscall.c |