Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/kmod.h
Show All 35 Lines | |||||
#include <sys/refcount.h> | #include <sys/refcount.h> | ||||
#include <sys/sbuf.h> | #include <sys/sbuf.h> | ||||
#include <machine/stdarg.h> | #include <machine/stdarg.h> | ||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
#define request_module(...) \ | #define request_module(...) \ | ||||
({\ | ({\ | ||||
char modname[128]; \ | char modname[128]; \ | ||||
int fileid; \ | int error, fileid; \ | ||||
snprintf(modname, sizeof(modname), __VA_ARGS__); \ | snprintf(modname, sizeof(modname), __VA_ARGS__); \ | ||||
kern_kldload(curthread, modname, &fileid); \ | error = curproc->p_fd->fd_rdir == NULL ? -EINVAL : \ | ||||
hselasky: Should you check if p_fd != NULL ? | |||||
-kern_kldload(curthread, modname, &fileid); \ | |||||
error; \ | |||||
}) | }) | ||||
#define request_module_nowait request_module | #define request_module_nowait request_module | ||||
#endif /* _LINUX_KMOD_H_ */ | #endif /* _LINUX_KMOD_H_ */ |
Should you check if p_fd != NULL ?