From patchwork Fri Feb 27 18:07:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Vesely X-Patchwork-Id: 5902371 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8FDB8BF6C3 for ; Fri, 27 Feb 2015 18:07:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CBCE620279 for ; Fri, 27 Feb 2015 18:07:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0167420270 for ; Fri, 27 Feb 2015 18:07:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E99686E937; Fri, 27 Feb 2015 10:07:35 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qa0-f42.google.com (mail-qa0-f42.google.com [209.85.216.42]) by gabe.freedesktop.org (Postfix) with ESMTP id 9ABFF6E92F for ; Fri, 27 Feb 2015 10:07:32 -0800 (PST) Received: by mail-qa0-f42.google.com with SMTP id w8so13954358qac.1 for ; Fri, 27 Feb 2015 10:07:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=BaAr2xWyy+NUenfwJnn1ivEBZfeKsD10dO6AanPVfkI=; b=ZnJdgGg5eBr9Rp98euYkY8mxWXpZNCrSjqkvosjF5qgav+UtbU8YCHSmwmN5n3pA1t kGVCZTxvCIxIMI+fCwIHgwqZhdGHxV6lCtAx/JngRhleRwD7l6q/9AtgG2uoxdmm+ns9 XH5Y6ttNPqLtVtAMpPdIYaPDf7c0c2SWZVRIGIpeSoYWIiVt/8h15PYR+0Ge2AKak4TX ClHkp24+zUzUqM2pN9rm2KHUlxgng7+uBZqFYgwj4LLR7rbw8BVGT5x55b3FWd5yPW4B 5k7Wqrzgbx9X2yocCaseFcHyf/71zW3wqDJwAgCtJZX8h3h0wfgAT4B5p46gMX+LysJR 3jIA== X-Gm-Message-State: ALoCoQmMO7lej1f1xYGmBhpIerdGXJ+fdyDWhYd6TfCSpYyUHCaRCU3czZPPXeZcKg5ioehgmWeT X-Received: by 10.140.28.97 with SMTP id 88mr30346904qgy.6.1425060452157; Fri, 27 Feb 2015 10:07:32 -0800 (PST) Received: from adriatix.rutgers.edu ([198.151.130.147]) by mx.google.com with ESMTPSA id 70sm3062318qhe.29.2015.02.27.10.07.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Feb 2015 10:07:31 -0800 (PST) From: Jan Vesely To: Emil Velikov , dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 4/8] xf86drmSL: Fix neighbour printing Date: Fri, 27 Feb 2015 13:07:24 -0500 Message-Id: <1425060448-5315-5-git-send-email-jan.vesely@rutgers.edu> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1425060448-5315-1-git-send-email-jan.vesely@rutgers.edu> References: <1425060448-5315-1-git-send-email-jan.vesely@rutgers.edu> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jan Vesely --- xf86drmSL.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xf86drmSL.c b/xf86drmSL.c index acddb54..2160bb8 100644 --- a/xf86drmSL.c +++ b/xf86drmSL.c @@ -266,11 +266,14 @@ int drmSLLookupNeighbors(void *l, unsigned long key, SkipListPtr list = (SkipListPtr)l; SLEntryPtr update[SL_MAX_LEVEL + 1]; int retcode = 0; + SLEntryPtr entry; + + entry = SLLocate(list, key, update); *prev_key = *next_key = key; *prev_value = *next_value = NULL; - - if (update[0]) { + + if (entry && update[0]) { *prev_key = update[0]->key; *prev_value = update[0]->value; ++retcode;