cpucontrol: check for the supposed firmware file type and skip
non-regular entry. do_update() skips entries with DT_DIR type. This does not eliminate other entries that might exist in the directory. More, since NFS might fill d_type with DT_UNKNOWN, dot and dotdot entries are not skipped, then mmap(2) call failed for them when update microcode files are located on NFS. Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
6651cf410c
commit
e4e0dad424
@ -369,6 +369,8 @@ try_a_fw_image(const char *dev_path, int devfd, int fwdfd, const char *dpath,
|
|||||||
rc = 0;
|
rc = 0;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
if (!S_ISREG(st.st_mode))
|
||||||
|
goto out;
|
||||||
if (st.st_size <= 0) {
|
if (st.st_size <= 0) {
|
||||||
WARN(0, "%s: empty", fw_path);
|
WARN(0, "%s: empty", fw_path);
|
||||||
goto out;
|
goto out;
|
||||||
|
Loading…
Reference in New Issue
Block a user