Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762431AbYGOPcv (ORCPT ); Tue, 15 Jul 2008 11:32:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1762139AbYGOPca (ORCPT ); Tue, 15 Jul 2008 11:32:30 -0400 Received: from ra.tuxdriver.com ([70.61.120.52]:3559 "EHLO ra.tuxdriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762132AbYGOPc3 (ORCPT ); Tue, 15 Jul 2008 11:32:29 -0400 Date: Tue, 15 Jul 2008 11:31:40 -0400 From: Neil Horman To: linux-kernel@vger.kernel.org Cc: akpm@linux-foundation.org, herbert@gondor.apana.org.au, mingo@elte.hu, nhorman@tuxdriver.com Subject: [cyrpto]: fix bad ERRPTR check in prng Message-ID: <20080715153140.GD4918@hmsreliant.think-freely.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Patch to correct a bad return code check from crypto_alloc_blkcipher Also correct Kconfig to pull in the needed ciphers to make prng work when its enabled Signed-off-by: Neil Horman prng_lock); if (reset_prng_context(ctx, NULL, NULL, NULL, NULL)) { @@ -357,9 +360,10 @@ int reset_prng_context(struct prng_context *ctx, crypto_free_blkcipher(ctx->tfm); ctx->tfm = crypto_alloc_blkcipher("rfc3686(ctr(aes))", 0, 0); - if (!ctx->tfm) { + if (IS_ERR(ctx->tfm)) { dbgprint(KERN_CRIT "Failed to alloc tfm for context %p\n", - ctx->tfm); + ctx); + ctx->tfm = NULL; goto out; } -- /**************************************************** * Neil Horman * Software Engineer, Red Hat ****************************************************/