From patchwork Fri Nov 27 16:46:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 11936727 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 625A915E6 for ; Fri, 27 Nov 2020 16:46:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 46F67221EB for ; Fri, 27 Nov 2020 16:46:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="I96eT258" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731975AbgK0QqX (ORCPT ); Fri, 27 Nov 2020 11:46:23 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:32437 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731438AbgK0QqX (ORCPT ); Fri, 27 Nov 2020 11:46:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606495582; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zGZTiwKPbzuNxYRc0EhfYab3vSDv6XVztRD7Rd/Qdu8=; b=I96eT258QX4vXb75WpJrkIXgHnK/EOV0czyHp/Z3EZvutjR4Y1JSQaatDOgJrJIcCpAFkW KtVW1pHzk5H9b/R/TiI7TSK7AtFPvRkCWOpgGDWQ3HXeSsyt53H5XQxRIAILmCbskpxYYq aNZgyYFVl34DRVr88snNZ5pBBz4U/M8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-262-K9r7XvQOPMWUAzziIVS4dA-1; Fri, 27 Nov 2020 11:46:19 -0500 X-MC-Unique: K9r7XvQOPMWUAzziIVS4dA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A62943FD0; Fri, 27 Nov 2020 16:46:18 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-112-159.rdu2.redhat.com [10.10.112.159]) by smtp.corp.redhat.com (Postfix) with ESMTP id A442B5D6D1; Fri, 27 Nov 2020 16:46:17 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 7/9] KEYS: remove redundant memset From: David Howells To: Jarkko Sakkinen Cc: Tom Rix , dhowells@redhat.com, keyrings@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 27 Nov 2020 16:46:16 +0000 Message-ID: <160649557681.2744658.2307630527176652528.stgit@warthog.procyon.org.uk> In-Reply-To: <160649552401.2744658.15096366594785577090.stgit@warthog.procyon.org.uk> References: <160649552401.2744658.15096366594785577090.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.23 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: keyrings@vger.kernel.org From: Tom Rix Reviewing use of memset in keyctrl_pkey.c keyctl_pkey_params_get prologue code to set params up memset(params, 0, sizeof(*params)); params->encoding = "raw"; keyctl_pkey_query has the same prologue and calls keyctl_pkey_params_get. So remove the prologue. Signed-off-by: Tom Rix Signed-off-by: David Howells --- security/keys/keyctl_pkey.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/security/keys/keyctl_pkey.c b/security/keys/keyctl_pkey.c index 931d8dfb4a7f..5de0d599a274 100644 --- a/security/keys/keyctl_pkey.c +++ b/security/keys/keyctl_pkey.c @@ -166,8 +166,6 @@ long keyctl_pkey_query(key_serial_t id, struct kernel_pkey_query res; long ret; - memset(¶ms, 0, sizeof(params)); - ret = keyctl_pkey_params_get(id, _info, ¶ms); if (ret < 0) goto error;