Commit 25b2b22d authored by John Paul Adrian Glaubitz's avatar John Paul Adrian Glaubitz Committed by Daniel Kiper

ieee1275: Fix crash in of_path_of_nvme when of_path is empty

The of_path_of_nvme function (commit 2391d579, ieee1275: add nvme
support within ofpath) introduced a functional regression:

On systems which are not based on Open Firmware but have at
least one NVME device, find_obppath will return NULL and thus
trying to append the disk name to of_path will result in a

The proper behavior of of_path_of_nvme is, however, to just
return NULL in such cases, like other users of find_obppath,
such as of_path_of_scsi.
Signed-off-by: default avatarJohn Paul Adrian Glaubitz <>
Reviewed-by: default avatarEric Snowberg <>
Reviewed-by: default avatarDaniel Kiper <>
parent 413f1e13
......@@ -389,8 +389,11 @@ of_path_of_nvme(const char *sys_devname __attribute__((unused)),
of_path = find_obppath (sysfs_path);
free (sysfs_path);
if (of_path)
strcat (of_path, disk);
free (sysfs_path);
return of_path;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment