lkml.org 
[lkml]   [2005]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] no more need to check for NULL before calls to crypto_free_tfm
From
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-07-18 17:35    [W:0.038 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site