lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 4 May 2007 13:39:20 +0530
From:	"Satyam Sharma" <satyam.sharma@...il.com>
To:	"Richard Purdie" <rpurdie@...nedhand.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	"David Woodhouse" <dwmw2@...radead.org>,
	herbert@...dor.apana.org.au,
	linux-mtd <linux-mtd@...ts.infradead.org>,
	linux-crypto@...r.kernel.org
Subject: Re: [PATCH 5/5] crypto: Add LZO compression support to the crypto interface

On 5/1/07, Richard Purdie <rpurdie@...nedhand.com> 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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ