Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1767709AbXEDIJY (ORCPT ); Fri, 4 May 2007 04:09:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1767715AbXEDIJY (ORCPT ); Fri, 4 May 2007 04:09:24 -0400 Received: from wr-out-0506.google.com ([64.233.184.238]:12493 "EHLO wr-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1767712AbXEDIJV (ORCPT ); Fri, 4 May 2007 04:09:21 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ZZYijeFtDmiVEhStGO813cGO/IoERx3e4ktv8dZEOJiDqkJOR51bKaKU0yzSWCBsGl7R4CiXPC1p9hlRk509V5LuvsUF4I8s6gF0yf0Hand5Eb1viMfFTfIk9S49hZXmSM1eiIxsB0OE4sDNIxly4OYfnPEFJkTFO6L3cBIW5E0= Message-ID: Date: Fri, 4 May 2007 13:39:20 +0530 From: "Satyam Sharma" To: "Richard Purdie" Subject: Re: [PATCH 5/5] crypto: Add LZO compression support to the crypto interface Cc: LKML , "David Woodhouse" , herbert@gondor.apana.org.au, linux-mtd , linux-crypto@vger.kernel.org In-Reply-To: <1178030843.5883.57.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1178030843.5883.57.camel@localhost.localdomain> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 741 Lines: 21 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. - 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/