Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759999AbbKUJjH (ORCPT ); Sat, 21 Nov 2015 04:39:07 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:36455 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754802AbbKUJjF (ORCPT ); Sat, 21 Nov 2015 04:39:05 -0500 Date: Sat, 21 Nov 2015 18:37:35 +0900 From: Sergey Senozhatsky To: Kyeongdon Kim Cc: minchan@kernel.org, akpm@linux-foundation.org, ngupta@vflare.org, linux-kernel@vger.kernel.org, sergey.senozhatsky@gmail.com, sergey.senozhatsky.work@gmail.com Subject: Re: [PATCH v2] zram: Prevent page allocation failure during zcomp_strm_alloc Message-ID: <20151121093735.GA561@swordfish> References: <1448013764-21899-1-git-send-email-kyeongdon.kim@lge.com> <20151121021059.GA3121@swordfish> <20151121021542.GB3121@swordfish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151121021542.GB3121@swordfish> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 742 Lines: 30 On (11/21/15 11:15), Sergey Senozhatsky wrote: [..] > > with the only nit that the subject should be "try kmalloc() before vmalloc()" > or similar, not "prevent page allocation failure", I think. > Oh, and one more thing > static void zcomp_lz4_destroy(void *private) > { > - kfree(private); > + if (is_vmalloc_addr(private)) > + vfree(private); > + else > + kfree(private); > } static void zcomp_FOO_destroy(void *private) { kvfree(private); } -ss -- 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/