diff options
Diffstat (limited to 'common/bootchooser.c')
-rw-r--r-- | common/bootchooser.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/common/bootchooser.c b/common/bootchooser.c index 455f290fa2..83b15e0f78 100644 --- a/common/bootchooser.c +++ b/common/bootchooser.c @@ -367,18 +367,16 @@ struct bootchooser *bootchooser_get(void) char *state_devname; delim = strchr(state_prefix, '.'); - if (!delim) { - pr_err("state_prefix '%s' has invalid format\n", - state_prefix); - goto err; - } - state_devname = xstrndup(state_prefix, delim - state_prefix); + if (delim) + state_devname = xstrndup(state_prefix, delim - state_prefix); + else + state_devname = xstrdup(state_prefix); bc->state_prefix = xstrdup(state_prefix); bc->state = state_by_name(state_devname); if (!bc->state) { - free(state_devname); pr_err("Cannot get state '%s'\n", state_devname); + free(state_devname); ret = -ENODEV; goto err; } |