diff options
| author | Marius Strobl <marius@FreeBSD.org> | 2005-10-25 12:49:56 +0000 |
|---|---|---|
| committer | Marius Strobl <marius@FreeBSD.org> | 2005-10-25 12:49:56 +0000 |
| commit | 79aae78c8906b05a9d08bc17739230e2d483205b (patch) | |
| tree | 2a817b11235fc00d9faf442ad08fdd4a7f2234c7 /sys/boot | |
| parent | a92cb60b4e08503e6768e9bc0a4314836e9b94cc (diff) | |
Notes
Diffstat (limited to 'sys/boot')
| -rw-r--r-- | sys/boot/ofw/libofw/devicename.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/boot/ofw/libofw/devicename.c b/sys/boot/ofw/libofw/devicename.c index a2c48975417ae..3cae23ce2024a 100644 --- a/sys/boot/ofw/libofw/devicename.c +++ b/sys/boot/ofw/libofw/devicename.c @@ -99,9 +99,13 @@ ofw_parsedev(struct ofw_devdesc **dev, const char *devspec, const char **path) return(ENOENT); found: - if (*s != '\0') + if (path != NULL && *s != '\0') *path = s; idev = malloc(sizeof(struct ofw_devdesc)); + if (idev == NULL) { + printf("ofw_parsedev: malloc failed\n"); + return ENOMEM; + } strcpy(idev->d_path, name); idev->d_dev = dv; idev->d_type = dv->dv_type; |
