Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422797AbXEDIjo (ORCPT ); Fri, 4 May 2007 04:39:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1031356AbXEDIjn (ORCPT ); Fri, 4 May 2007 04:39:43 -0400 Received: from 3a.49.1343.static.theplanet.com ([67.19.73.58]:42286 "EHLO pug.o-hand.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932840AbXEDIjm (ORCPT ); Fri, 4 May 2007 04:39:42 -0400 Subject: Re: [PATCH 5/5] crypto: Add LZO compression support to the crypto interface From: Richard Purdie To: Satyam Sharma Cc: LKML , David Woodhouse , herbert@gondor.apana.org.au, linux-mtd , linux-crypto@vger.kernel.org In-Reply-To: References: <1178030843.5883.57.camel@localhost.localdomain> Content-Type: text/plain Date: Fri, 04 May 2007 09:39:23 +0100 Message-Id: <1178267963.5839.10.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 885 Lines: 27 On Fri, 2007-05-04 at 13:39 +0530, Satyam Sharma wrote: > On 5/1/07, Richard Purdie wrote: > > +static int lzo_init(struct crypto_tfm *tfm) > > +{ > > + struct lzo_ctx *ctx = crypto_tfm_ctx(tfm); > > + > > + ctx->lzo_mem = vmalloc(LZO1X_MEM_COMPRESS); > > + > > + if (!ctx->lzo_mem) { > > + vfree(ctx->lzo_mem); > > Heh. What's (why's) this? You _can_ {k, v}free NULL but doing so after > explicitly checking for it is ... ... insane! True, there used to be two buffers allocated there and I've missed a sensible cleanup when I removed one. I'll fix it, thanks. Cheers, Richard - 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/