Re: [PATCH] no more need to check for NULL before calls to crypto_free_tfm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux