ieee1275: Fix crash in of_path_of_nvme when of_path is empty
authorJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Thu, 1 Mar 2018 22:34:53 +0000 (23:34 +0100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 5 Mar 2018 13:36:28 +0000 (14:36 +0100)
commit25b2b22d5457b21ccd764c4e5af6ce37ba25b975
tree69d710d89aa344c0e48654502fc3eb2ac310bf66
parent413f1e13e69e1df130e9f39684fb7c0c216e5035
ieee1275: Fix crash in of_path_of_nvme when of_path is empty

The of_path_of_nvme function (commit 2391d57, 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
crash.

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: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Reviewed-by: Eric Snowberg <eric.snowberg@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/osdep/linux/ofpath.c