Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760959Ab2BNPDn (ORCPT ); Tue, 14 Feb 2012 10:03:43 -0500 Received: from smtp110.prem.mail.ac4.yahoo.com ([76.13.13.93]:45933 "HELO smtp110.prem.mail.ac4.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1756682Ab2BNPDj (ORCPT ); Tue, 14 Feb 2012 10:03:39 -0500 X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: dg7GTOkVM1mrKUP9NPLJ41a0QimJlixzmGgY8eBVN0kTzjP 641jcd4McUQ1srKI432jNzFybF6WzmthPvRkfnxJ0Blj0RDDW39wyo5fi1D_ qR8lW2FxlxovN0B3cdneA2m6CwVdCnBDWkmftUZrYNY6CvhSfJiKD.vPkD1I ZI5AZA3LFDeGgSb58BEt8zAXUbhh9ll92gjctYNX8mvcl01_jpM56Pu_5jan iP_9rwI3cvlhw_EGGatIhCV82lXj37OhukMFVIqruTj6APjTM38WVK8eO7EF bI.RJxlJi0mhjB7QKRGRY931eKrpsHHd_ChZu5hm.Iz4IBeRx8hSPiqy8mBQ mbSOva9RFp0pRjs9Kp0A6HsY.UVBYjsBXVZYCLVvsWUKny8S3wSULSqABtLO ebDRsKojEWKo5D5WMRC_LtCc5SwBkgbgH9emN X-Yahoo-SMTP: _Dag8S.swBC1p4FJKLCXbs8NQzyse1SYSgnAbY0- Date: Tue, 14 Feb 2012 09:03:36 -0600 (CST) From: Christoph Lameter X-X-Sender: cl@router.home To: Yang Bai cc: penberg@kernel.org, mpm@selenic.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] slab: warning if total alloc size overflow In-Reply-To: <1329204499-2671-1-git-send-email-hamo.by@gmail.com> Message-ID: References: <1329204499-2671-1-git-send-email-hamo.by@gmail.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 727 Lines: 18 On Tue, 14 Feb 2012, Yang Bai wrote: > Before, if the total alloc size is overflow, > we just return NULL like alloc fail. But they > are two different type problems. The former looks > more like a programming problem. So add a warning > here. Acked-by: Christoph Lameter Would be better to remove kcalloc and provide a generalized array size calculation function that does the WARN(). That would also work for all other variants zeroed or NUMA node spec etc etc. -- 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/