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

2005-07-18 Thread Jesper Juhl
On 7/18/05, Herbert Xu <[EMAIL PROTECTED]> wrote:
> 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.0 +0200
> > +++ linux-2.6.13-rc3/drivers/block/cryptoloop.c   2005-07-16 
> > 23:35:55.0 +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.
> 
Hmm, I guess you're right. Dunno why I reordered that, but you are
right, it's pretty pointless. Except for getting rid of the cast, that
makes sense, it's superfluous so it should go away...

> The rest of the patch looks good.
> 
> Thanks,

You're welcome. Thank you for reviewing it.


-- 
Jesper Juhl <[EMAIL PROTECTED]>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please  http://www.expita.com/nomime.html
-
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/


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

2005-07-18 Thread Herbert Xu
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.0 +0200
> +++ linux-2.6.13-rc3/drivers/block/cryptoloop.c   2005-07-16 
> 23:35:55.0 +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/