From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753273AbcHOTmn (ORCPT ); Mon, 15 Aug 2016 15:42:43 -0400 Received: from mga02.intel.com ([134.134.136.20]:37033 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752360AbcHOTmm (ORCPT ); Mon, 15 Aug 2016 15:42:42 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,526,1464678000"; d="scan'208";a="749062419" From: Ross Zwisler To: linux-kernel@vger.kernel.org Cc: Ross Zwisler , Konstantin Khlebnikov , Andrew Morton , linux-nvdimm@ml01.01.org, Andrey Ryabinin , Dmitry Vyukov Subject: [PATCH v2 0/3] 'slot' can be NULL in radix_tree_next_slot() Date: Mon, 15 Aug 2016 13:42:34 -0600 Message-Id: <20160815194237.25967-1-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.9.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds comments above radix_tree_next_slot() documenting the combination of factors that prevent us from dereferencing a NULL 'slot' pointer. It also adds a radix tree unit test so that we can easily catch any unhandled NULL pointer issues with radix_tree_next_slot(). Changes from V1: - Instead of adding an explicit check for 'slot' being NULL at the beginning of radix_tree_next_slot(), document what factors are keeping us safe instead. (Konstantin) Ross Zwisler (3): radix-tree: 'slot' can be NULL in radix_tree_next_slot() radix-tree tests: add iteration test radix-tree tests: properly initialize mutex include/linux/radix-tree.h | 8 ++ tools/testing/radix-tree/Makefile | 3 +- tools/testing/radix-tree/iteration_check.c | 180 +++++++++++++++++++++++++++++ tools/testing/radix-tree/main.c | 1 + tools/testing/radix-tree/regression1.c | 2 +- tools/testing/radix-tree/test.h | 1 + 6 files changed, 193 insertions(+), 2 deletions(-) create mode 100644 tools/testing/radix-tree/iteration_check.c -- 2.9.0