mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Jesper Juhl <jesper.juhl@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH] no more need to check for NULL before calls to crypto_free_tfm
Date: Tue, 19 Jul 2005 01:30:55 +1000	[thread overview]
Message-ID: <20050718153055.GA14719@gondor.apana.org.au> (raw)
In-Reply-To: <200507170032.28174.jesper.juhl@gmail.com>

On Sun, Jul 17, 2005 at 12:32:27AM +0200, Jesper Juhl wrote:
> 
> --- linux-2.6.13-rc3-orig/drivers/block/cryptoloop.c	2005-06-17 21:48:29.000000000 +0200
> +++ linux-2.6.13-rc3/drivers/block/cryptoloop.c	2005-07-16 23:35:55.000000000 +0200
> @@ -227,14 +227,14 @@ cryptoloop_ioctl(struct loop_device *lo,
>  static int
>  cryptoloop_release(struct loop_device *lo)
>  {
> -	struct crypto_tfm *tfm = (struct crypto_tfm *) lo->key_data;
> -	if (tfm != NULL) {
> -		crypto_free_tfm(tfm);
> -		lo->key_data = NULL;
> -		return 0;
> +	struct crypto_tfm *tfm = lo->key_data;
> +	if (!tfm) {
> +		printk(KERN_ERR "cryptoloop_release(): tfm == NULL?\n");
> +		return -EINVAL;
>  	}
> -	printk(KERN_ERR "cryptoloop_release(): tfm == NULL?\n");
> -	return -EINVAL;
> +	crypto_free_tfm(tfm);
> +	lo->key_data = NULL;
> +	return 0;
>  }

This change looks rather pointless.

The rest of the patch looks good.

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

       reply	other threads:[~2005-07-18 15:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200507170032.28174.jesper.juhl@gmail.com>
2005-07-18 15:30 ` Herbert Xu [this message]
2005-07-19  0:12   ` Jesper Juhl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050718153055.GA14719@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=davem@davemloft.net \
    --cc=jesper.juhl@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®