From: "Satyam Sharma" Subject: Re: [PATCH 5/5] crypto: Add LZO compression support to the crypto interface Date: Fri, 4 May 2007 13:39:20 +0530 Message-ID: References: <1178030843.5883.57.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: LKML , "David Woodhouse" , herbert@gondor.apana.org.au, linux-mtd , linux-crypto@vger.kernel.org To: "Richard Purdie" Return-path: Received: from wr-out-0506.google.com ([64.233.184.239]:12875 "EHLO wr-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1767709AbXEDIJV (ORCPT ); Fri, 4 May 2007 04:09:21 -0400 Received: by wr-out-0506.google.com with SMTP id 76so817802wra for ; Fri, 04 May 2007 01:09:21 -0700 (PDT) In-Reply-To: <1178030843.5883.57.camel@localhost.localdomain> Content-Disposition: inline Sender: linux-crypto-owner@vger.kernel.org List-Id: linux-crypto.vger.kernel.org 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! > + return -ENOMEM; Yeah. Just return -ENOMEM; and be done with it.