* Re: [PATCH] no more need to check for NULL before calls to crypto_free_tfm
[not found] <200507170032.28174.jesper.juhl@gmail.com>
@ 2005-07-18 15:30 ` Herbert Xu
2005-07-19 0:12 ` Jesper Juhl
0 siblings, 1 reply; 2+ messages in thread
From: Herbert Xu @ 2005-07-18 15:30 UTC (permalink / raw)
To: Jesper Juhl; +Cc: linux-kernel, David S. Miller
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] no more need to check for NULL before calls to crypto_free_tfm
2005-07-18 15:30 ` [PATCH] no more need to check for NULL before calls to crypto_free_tfm Herbert Xu
@ 2005-07-19 0:12 ` Jesper Juhl
0 siblings, 0 replies; 2+ messages in thread
From: Jesper Juhl @ 2005-07-19 0:12 UTC (permalink / raw)
To: Herbert Xu; +Cc: linux-kernel, David S. Miller
On 7/18/05, Herbert Xu <herbert@gondor.apana.org.au> 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.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.
>
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 <jesper.juhl@gmail.com>
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-07-19 0:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200507170032.28174.jesper.juhl@gmail.com>
2005-07-18 15:30 ` [PATCH] no more need to check for NULL before calls to crypto_free_tfm Herbert Xu
2005-07-19 0:12 ` Jesper Juhl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox