From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F3634326D42 for ; Thu, 23 Oct 2025 14:33:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761230011; cv=none; b=WCFinUn/W+9iO3hdiSG38HU3CJ21uBEhlByD/R3u8i+2m1gKaMu5SCQxHmVYDQJ5eA6hyNqqeFM/HR1ph++WHhgfBtU2fSaR0njzMJcCLD1fn4KiaCSbVfDBaCEHgRjI5Tq89lEkbUYQA3gcAgLUhvTXXnEEd78FZT1pIL5bW6Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761230011; c=relaxed/simple; bh=q1noXuVmhs6IzlRRMFuZy58aKYcPzSJFmQpmGkuDL18=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ibOuRCXC4TFGLZuAgaK82m3IzqfZRZahfjzZp2I8H8bCGvCtYjB0Dcg4EYaKW5d0/+jSAiXtZrfRPqjR68vM1PJ4hFFPT4H5AgWIU39pLfEUVXi3siba2mQuI+HBHCFDFA5/efLm82IAz2MlJPTP91y/tyk9cyKlmmWUNRRF5Zc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=ARAU11sL; arc=none smtp.client-ip=91.218.175.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="ARAU11sL" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1761230008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cI5x2xe0LgJrlOJDS01Ib8lu2qcPZVA4kvnCx2FtvEk=; b=ARAU11sLfSlto6LfgVIvpg8VCG786XBRpbRUGlpOnhdSTI3veQOPtRMbwqdkrvU6iU2De8 ZCHpG4ThiWZ8OuV/qbIil8iw5kSYtEyvVFH88Q+sVDf0KDHfc3pihX3+5lzkf9dn4VdmjS u46a48AJdtQRJqI0LSUJBwtA3X8OlQk= From: Thorsten Blum To: David Howells , Jarkko Sakkinen , Paul Moore , James Morris , "Serge E. Hallyn" Cc: Thorsten Blum , keyrings@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] keys: Remove unnecessary local variable from proc_keys_show Date: Thu, 23 Oct 2025 16:32:33 +0200 Message-ID: <20251023143231.2086-4-thorsten.blum@linux.dev> In-Reply-To: <20251023143231.2086-2-thorsten.blum@linux.dev> References: <20251023143231.2086-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT The local variable 'rc' is only used to temporary store the result of calling key_task_permission(). Use the result directly and remove the local variable. Signed-off-by: Thorsten Blum --- security/keys/proc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/security/keys/proc.c b/security/keys/proc.c index 4f4e2c1824f1..39af57af2aad 100644 --- a/security/keys/proc.c +++ b/security/keys/proc.c @@ -160,7 +160,6 @@ static int proc_keys_show(struct seq_file *m, void *v) char xbuf[16]; short state; u64 timo; - int rc; struct keyring_search_context ctx = { .index_key = key->index_key, @@ -188,8 +187,7 @@ static int proc_keys_show(struct seq_file *m, void *v) } /* check whether the current task is allowed to view the key */ - rc = key_task_permission(key_ref, ctx.cred, KEY_NEED_VIEW); - if (rc < 0) + if (key_task_permission(key_ref, ctx.cred, KEY_NEED_VIEW) < 0) return 0; now = ktime_get_real_seconds(); -- 2.51.0