Linux-Security-Module Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] integrity: remove redundant initialization of variable ret
@ 2020-07-01 13:46 Colin King
  2020-07-27 18:05 ` James Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2020-07-01 13:46 UTC (permalink / raw)
  To: James Morris, Serge E . Hallyn, linux-security-module
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The variable ret is being initialized with a value that is never read
and it is being updated later with a new value.  The initialization is
redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 security/integrity/digsig_asymmetric.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/integrity/digsig_asymmetric.c b/security/integrity/digsig_asymmetric.c
index 4e0d6778277e..cfa4127d0518 100644
--- a/security/integrity/digsig_asymmetric.c
+++ b/security/integrity/digsig_asymmetric.c
@@ -79,7 +79,7 @@ int asymmetric_verify(struct key *keyring, const char *sig,
 	struct public_key_signature pks;
 	struct signature_v2_hdr *hdr = (struct signature_v2_hdr *)sig;
 	struct key *key;
-	int ret = -ENOMEM;
+	int ret;
 
 	if (siglen <= sizeof(*hdr))
 		return -EBADMSG;
-- 
2.27.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] integrity: remove redundant initialization of variable ret
  2020-07-01 13:46 [PATCH] integrity: remove redundant initialization of variable ret Colin King
@ 2020-07-27 18:05 ` James Morris
  2020-07-27 20:57   ` Mimi Zohar
  0 siblings, 1 reply; 3+ messages in thread
From: James Morris @ 2020-07-27 18:05 UTC (permalink / raw)
  To: Colin King, Mimi Zohar
  Cc: Serge E . Hallyn, linux-security-module, kernel-janitors, linux-kernel

On Wed, 1 Jul 2020, Colin King wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable ret is being initialized with a value that is never read
> and it is being updated later with a new value.  The initialization is
> redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  security/integrity/digsig_asymmetric.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/security/integrity/digsig_asymmetric.c b/security/integrity/digsig_asymmetric.c
> index 4e0d6778277e..cfa4127d0518 100644
> --- a/security/integrity/digsig_asymmetric.c
> +++ b/security/integrity/digsig_asymmetric.c
> @@ -79,7 +79,7 @@ int asymmetric_verify(struct key *keyring, const char *sig,
>  	struct public_key_signature pks;
>  	struct signature_v2_hdr *hdr = (struct signature_v2_hdr *)sig;
>  	struct key *key;
> -	int ret = -ENOMEM;
> +	int ret;

Assuming Mimi will grab this.


Acked-by: James Morris <jamorris@linux.microsoft.com>

-- 
James Morris
<jmorris@namei.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] integrity: remove redundant initialization of variable ret
  2020-07-27 18:05 ` James Morris
@ 2020-07-27 20:57   ` Mimi Zohar
  0 siblings, 0 replies; 3+ messages in thread
From: Mimi Zohar @ 2020-07-27 20:57 UTC (permalink / raw)
  To: James Morris, Colin King, Mimi Zohar
  Cc: Serge E . Hallyn, linux-security-module, kernel-janitors, linux-kernel

On Tue, 2020-07-28 at 04:05 +1000, James Morris wrote:
> On Wed, 1 Jul 2020, Colin King wrote:
> 
> > From: Colin Ian King <colin.king@canonical.com>
> > 
> > The variable ret is being initialized with a value that is never read
> > and it is being updated later with a new value.  The initialization is
> > redundant and can be removed.
> > 
> > Addresses-Coverity: ("Unused value")
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
> > ---
> >  security/integrity/digsig_asymmetric.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/security/integrity/digsig_asymmetric.c b/security/integrity/digsig_asymmetric.c
> > index 4e0d6778277e..cfa4127d0518 100644
> > --- a/security/integrity/digsig_asymmetric.c
> > +++ b/security/integrity/digsig_asymmetric.c
> > @@ -79,7 +79,7 @@ int asymmetric_verify(struct key *keyring, const char *sig,
> >  	struct public_key_signature pks;
> >  	struct signature_v2_hdr *hdr = (struct signature_v2_hdr *)sig;
> >  	struct key *key;
> > -	int ret = -ENOMEM;
> > +	int ret;
> 
> Assuming Mimi will grab this.
> 
> 
> Acked-by: James Morris <jamorris@linux.microsoft.com>

Yes, thank you for the reminder.

Mimi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-01 13:46 [PATCH] integrity: remove redundant initialization of variable ret Colin King
2020-07-27 18:05 ` James Morris
2020-07-27 20:57   ` Mimi Zohar

Linux-Security-Module Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-security-module/0 linux-security-module/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-security-module linux-security-module/ https://lore.kernel.org/linux-security-module \
		linux-security-module@vger.kernel.org
	public-inbox-index linux-security-module

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-security-module


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git