Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309730
b: refs/heads/master
c: 81ab6e7
h: refs/heads/master
v: v3
  • Loading branch information
Boaz Harrosh authored and Linus Torvalds committed Jun 1, 2012
1 parent 2172649 commit 0086335
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ae3cef7300e9fddc35ad251dd5f27c5b88c8594a
refs/heads/master: 81ab6e7b26b453a795d46f2616ed0e31d97f05b9
19 changes: 8 additions & 11 deletions trunk/kernel/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -2114,26 +2114,23 @@ int orderly_poweroff(bool force)
NULL
};
int ret = -ENOMEM;
struct subprocess_info *info;

if (argv == NULL) {
printk(KERN_WARNING "%s failed to allocate memory for \"%s\"\n",
__func__, poweroff_cmd);
goto out;
}

info = call_usermodehelper_setup(argv[0], argv, envp, GFP_ATOMIC);
if (info == NULL) {
argv_free(argv);
goto out;
}

call_usermodehelper_setfns(info, NULL, argv_cleanup, NULL);
ret = call_usermodehelper_fns(argv[0], argv, envp, UMH_NO_WAIT,
NULL, argv_cleanup, NULL);
out:
if (likely(!ret))
return 0;

ret = call_usermodehelper_exec(info, UMH_NO_WAIT);
if (ret == -ENOMEM)
argv_free(argv);

out:
if (ret && force) {
if (force) {
printk(KERN_WARNING "Failed to start orderly shutdown: "
"forcing the issue\n");

Expand Down
13 changes: 3 additions & 10 deletions trunk/security/keys/request_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,9 @@ static void umh_keys_cleanup(struct subprocess_info *info)
static int call_usermodehelper_keys(char *path, char **argv, char **envp,
struct key *session_keyring, int wait)
{
gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL;
struct subprocess_info *info =
call_usermodehelper_setup(path, argv, envp, gfp_mask);

if (!info)
return -ENOMEM;

call_usermodehelper_setfns(info, umh_keys_init, umh_keys_cleanup,
key_get(session_keyring));
return call_usermodehelper_exec(info, wait);
return call_usermodehelper_fns(path, argv, envp, wait,
umh_keys_init, umh_keys_cleanup,
key_get(session_keyring));
}

/*
Expand Down

0 comments on commit 0086335

Please sign in to comment.