grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ieee1275: Fix crash in of_path_of_nvme when of_path is empty


From: Daniel Kiper
Subject: Re: [PATCH] ieee1275: Fix crash in of_path_of_nvme when of_path is empty
Date: Mon, 5 Mar 2018 17:04:45 +0100
User-agent: Mutt/1.3.28i

On Thu, Mar 01, 2018 at 08:10:10PM -0700, Eric Snowberg wrote:
> > On Mar 1, 2018, at 3:34 PM, John Paul Adrian Glaubitz <address@hidden> 
> > wrote:
> >
> > 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 <address@hidden>
> > ---
> > grub-core/osdep/linux/ofpath.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c
> > index 1c30e7233..61806212e 100644
> > --- a/grub-core/osdep/linux/ofpath.c
> > +++ b/grub-core/osdep/linux/ofpath.c
> > @@ -389,8 +389,11 @@ of_path_of_nvme(const char *sys_devname 
> > __attribute__((unused)),
> >     }
> >
> >   of_path = find_obppath (sysfs_path);
> > +
> > +  if (of_path)
> > +    strcat (of_path, disk);
> > +
> >   free (sysfs_path);
> > -  strcat (of_path, disk);
> >   return of_path;
> > }
> >
> > --
> > 2.16.2
>
> Reviewed-by: Eric Snowberg <address@hidden>

Applied. Please CC me next time.

Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]