Skip to content

Commit

Permalink
bootchooser: allow an empty namespace
Browse files Browse the repository at this point in the history
The bootchooser's documentation states the 'namespace' for the state
storage backend is optional. This change makes it really optional to allow
a flat state variable set definition for the 'bootchooser' as well.

Signed-off-by: Juergen Borleis <[email protected]>
Signed-off-by: Sascha Hauer <[email protected]>
  • Loading branch information
jbeptx authored and saschahauer committed Sep 6, 2017
1 parent 9f91974 commit eaf9a86
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions common/bootchooser.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,10 @@ 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) {
Expand Down

0 comments on commit eaf9a86

Please sign in to comment.