Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144969954
D39414.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
943 B
Referenced Files
None
Subscribers
None
D39414.diff
View Options
diff --git a/stand/userboot/userboot/main.c b/stand/userboot/userboot/main.c
--- a/stand/userboot/userboot/main.c
+++ b/stand/userboot/userboot/main.c
@@ -235,7 +235,6 @@
struct devdesc *dd;
#if defined(USERBOOT_ZFS_SUPPORT)
struct zfs_devdesc zdev;
- char *buf = NULL;
if (userboot_zfs_found) {
@@ -272,17 +271,14 @@
#if defined(USERBOOT_ZFS_SUPPORT)
if (userboot_zfs_found) {
- buf = malloc(VDEV_PAD_SIZE);
- if (buf != NULL) {
- if (zfs_get_bootonce(&zdev, OS_BOOTONCE, buf,
- VDEV_PAD_SIZE) == 0) {
- printf("zfs bootonce: %s\n", buf);
- set_currdev(buf);
- setenv("zfs-bootonce", buf, 1);
- }
- free(buf);
- (void) zfs_attach_nvstore(&zdev);
+ char buf[VDEV_PAD_SIZE];
+
+ if (zfs_get_bootonce(&zdev, OS_BOOTONCE, buf, sizeof(buf)) == 0) {
+ printf("zfs bootonce: %s\n", buf);
+ set_currdev(buf);
+ setenv("zfs-bootonce", buf, 1);
}
+ (void)zfs_attach_nvstore(&zdev);
}
#endif
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 15, 2:55 PM (6 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28745330
Default Alt Text
D39414.diff (943 B)
Attached To
Mode
D39414: stand/userboot: Simplify code
Attached
Detach File
Event Timeline
Log In to Comment