[PATCH] Keys: Get rid of warning in kmod.c if keys disabled
authorDavid Howells <dhowells@redhat.com>
Sun, 30 Oct 2005 23:02:44 +0000 (15:02 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 31 Oct 2005 01:37:23 +0000 (17:37 -0800)
The attached patch gets rid of a "statement without effect" warning when
CONFIG_KEYS is disabled by making use of the return value of key_get().
The compiler will optimise all of this away when keys are disabled.

Signed-Off-By: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/kmod.c

index 44166e3bb8afab469a61575946b46da45e215cc7..51a892063aaaa2f5b1dfa1cf9f6667dcef88cd68 100644 (file)
@@ -131,14 +131,14 @@ struct subprocess_info {
 static int ____call_usermodehelper(void *data)
 {
        struct subprocess_info *sub_info = data;
-       struct key *old_session;
+       struct key *new_session, *old_session;
        int retval;
 
        /* Unblock all signals and set the session keyring. */
-       key_get(sub_info->ring);
+       new_session = key_get(sub_info->ring);
        flush_signals(current);
        spin_lock_irq(&current->sighand->siglock);
-       old_session = __install_session_keyring(current, sub_info->ring);
+       old_session = __install_session_keyring(current, new_session);
        flush_signal_handlers(current, 1);
        sigemptyset(&current->blocked);
        recalc_sigpending();