Novel idea, don't print a string if it is NULL!

This protects people from loading _really_ old modules, like say from
5.x to a 6.x or 7.x system, like for instance right after an upgrade.
This commit is contained in:
Alfred Perlstein 2006-01-12 19:15:14 +00:00
parent 2df050ad10
commit 7d7e053c21
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154266

View File

@ -449,7 +449,8 @@ prep_cdevsw(struct cdevsw *devsw)
if (devsw->d_version != D_VERSION_01) {
printf(
"WARNING: Device driver \"%s\" has wrong version %s\n",
devsw->d_name, "and is disabled. Recompile KLD module.");
devsw->d_name == NULL ? "???" : devsw->d_name,
"and is disabled. Recompile KLD module.");
devsw->d_open = dead_open;
devsw->d_close = dead_close;
devsw->d_read = dead_read;