From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Wienand Subject: [PATCH] Fix segfault in read_distance_table when no NUMA Date: Wed, 19 Jun 2013 21:56:08 +1000 Message-ID: <20130619115608.GA30133@gmail.com> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wienand.org; s=wienand; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=mF6uni0F096S/TgC2+ldF2NcsbxTuPLSLrnrFWq8hzc=; b=auZIsGV5mXe/g2LsQsMUGQ4Lw2i+yotAODl9YNZb4CdEtolW1TFgCLdJlhQpj452+L W9PRjN6CfoR4AVrRWC42H36H23NsS9uFA3RoYsj7NJPogmKGWxvACJ8W2mybK9bqY9Uw qVlh3eBG8824thclKG5hz5L5yvvAWYYgyvH58= Content-Disposition: inline Sender: linux-numa-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-numa@vger.kernel.org Cc: 712692@bugs.debian.org Hi Debian bug #712692 reported a segfault on systems with no numa info. In this case, read_distance_table would exit with "0" which was not picked up as an error by numa_distance(), leading to a dereference of distance_table. Signed-off-by: Ian Wienand --- distance.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/distance.c b/distance.c index 4a26972..ec423c4 100755 --- a/distance.c +++ b/distance.c @@ -58,15 +58,13 @@ static int read_distance_table(void) int *table = NULL; int err = -1; - for (nd = 0;; nd++) { + for (nd = 0; nd