Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F159332615
D22571.id64941.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D22571.id64941.diff
View Options
Index: sys/kern/kern_linker.c
===================================================================
--- sys/kern/kern_linker.c
+++ sys/kern/kern_linker.c
@@ -2067,6 +2067,7 @@
struct linker_file *parent, const struct mod_depend *verinfo,
struct linker_file **lfpp)
{
+ struct proc *cp = curproc;
linker_file_t lfdep;
const char *filename;
char *pathname;
@@ -2079,13 +2080,17 @@
*/
KASSERT(verinfo == NULL, ("linker_load_module: verinfo"
" is not NULL"));
- if (rootvnode == NULL)
+ /* check if root file system is not mounted */
+ if (rootvnode == NULL || cp->p_fd == NULL ||
+ cp->p_fd->fd_rdir == NULL)
return (ENXIO);
pathname = linker_search_kld(kldname);
} else {
if (modlist_lookup2(modname, verinfo) != NULL)
return (EEXIST);
- if (rootvnode == NULL)
+ /* check if root file system is not mounted */
+ if (rootvnode == NULL || cp->p_fd == NULL ||
+ cp->p_fd->fd_rdir == NULL)
return (ENXIO);
if (kldname != NULL)
pathname = strdup(kldname, M_LINKER);
Index: sys/kern/subr_firmware.c
===================================================================
--- sys/kern/subr_firmware.c
+++ sys/kern/subr_firmware.c
@@ -257,7 +257,6 @@
static void
loadimage(void *arg, int npending)
{
- struct thread *td = curthread;
char *imagename = arg;
struct priv_fw *fp;
linker_file_t result;
@@ -267,11 +266,6 @@
mtx_lock(&firmware_mtx);
mtx_unlock(&firmware_mtx);
- if (td->td_proc->p_fd->fd_rdir == NULL) {
- printf("%s: root not mounted yet, no way to load image\n",
- imagename);
- goto done;
- }
error = linker_reference_module(imagename, NULL, &result);
if (error != 0) {
printf("%s: could not load firmware image, error %d\n",
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jun 13, 11:00 PM (13 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33935643
Default Alt Text
D22571.id64941.diff (1 KB)
Attached To
Mode
D22571: Factor out checks for mounted root file system
Attached
Detach File
Event Timeline
Log In to Comment