Security, of course, is a key concern these days. Professional developers are expected to write secure code. In recent years, there have been many known exploits against the Linux kernel (see the Further reading section for more on this). In parallel, many efforts toward improving Linux kernel security are in place.
In our preceding kernel module (ch5/min_sysinfo/min_sysinfo.c), be wary of using older-style routines (like the sprintf, strlen, and so on; yes, they're present within the kernel)! Static analyzers can greatly aid in catching potential security-related and other bugs; we highly recommend you use them. Chapter 1, Kernel Workspace Setup, mentions several useful static analysis tools for the kernel. In the following code, we use one of the sa targets within our our "better" Makefile to run a relatively simple static analyzer: flawfinder(1) (written by David Wheeler):
$ make...