From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Vesely Subject: Re: [PATCH libdrm 4/8] xf86drmSL: Fix neighbour printing Date: Fri, 20 Mar 2015 18:00:22 -0400 Message-ID: <1426888822.3949.36.camel@rutgers.edu> References: <1425060448-5315-1-git-send-email-jan.vesely@rutgers.edu> <1425060448-5315-5-git-send-email-jan.vesely@rutgers.edu> <550C5B1A.3060706@gmail.com> <1426874460.3949.30.camel@rutgers.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1055910068==" Return-path: Received: from mail-qc0-f176.google.com (mail-qc0-f176.google.com [209.85.216.176]) by gabe.freedesktop.org (Postfix) with ESMTP id 9F9C86E3B8 for ; Fri, 20 Mar 2015 15:00:24 -0700 (PDT) Received: by qcbjx9 with SMTP id jx9so66379364qcb.0 for ; Fri, 20 Mar 2015 15:00:24 -0700 (PDT) In-Reply-To: <1426874460.3949.30.camel@rutgers.edu> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Emil Velikov Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1055910068== Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-y5TozUMfrKrJsE12RHl+" --=-y5TozUMfrKrJsE12RHl+ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2015-03-20 at 14:01 -0400, Jan Vesely wrote: > On Fri, 2015-03-20 at 17:38 +0000, Emil Velikov wrote: > > On 27/02/15 18:07, Jan Vesely wrote: > > > Signed-off-by: Jan Vesely > > > --- > > > xf86drmSL.c | 7 +++++-- > > > 1 file changed, 5 insertions(+), 2 deletions(-) > > >=20 > > > 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 =3D (SkipListPtr)l; > > > SLEntryPtr update[SL_MAX_LEVEL + 1]; > > > int retcode =3D 0; > > > + SLEntryPtr entry; > > > + > > > + entry =3D SLLocate(list, key, update); > > > =20 > > > *prev_key =3D *next_key =3D key; > > > *prev_value =3D *next_value =3D NULL; > > > -=09 > > > - if (update[0]) { > > > + > > > + if (entry && update[0]) { > > From a very brief look at git log, the entry check should not be needed= . > > Must admit that I've not looked at all in the implementation of either > > SLLocate or drmSLLookupNeighbors. >=20 > SLLocate might return early and leave the array uninitialized. All other > calls to it check the return value. I guess the warning that the > previous commit tried to fix was "set-but-unused" variable. I take this back. You were right. SLLocate might return NULL in non-failing case, and we cannot rely on the return value. I'll post an updated patch (and a move to tests) shortly jan >=20 > >=20 > > That said it seems that none of the three files > > (xf86drm{SL,Hash,Random}) has been build as a program for a while. Mayb= e > > we could split it out as a standalone test and let it churn at make > > check time ? >=20 > Sounds like a good idea. I'll try to take a look when time permits, but > I'd leave that as a separate patch. >=20 > thanks, > jan >=20 > >=20 > > Cheers, > > Emil >=20 --=20 Jan Vesely --=-y5TozUMfrKrJsE12RHl+ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCgAGBQJVDJh2AAoJEDhUsXb6ZiH/S74P/0ju3zeEOVL/s5l6CtzzTp/S m2uSGBxA7PnRKQhp9Z1O9QwS7qoqRDBVbb89bmyyzMIENUR+6/LcRUqKvH0L4exS GkmkMkYkSJFv3cfBoOYusPLaKnoBGBmGxyOK23+scVn6PS/gyN3L51lBYszVVkN+ 8fS002YRm9zh42IZoun95KU2CqPQbkDfe3SstyOIRpyzlU0XQh+WkpZm9gO9fekP meXYHDCzNCJM7SXUsX/9m2OVzcRj5v0elaCyy5Sb33wromVyZpe09kSykHjVUavh uP1h59amD4cUYK3qI4SM8+ocwbBtBiMYKlRfQwVQZ7P9U0BULqhaWREva/U4ojPh FOA0gwbiL2pZC2Mivf8jicL73JERyCSmRiQYP4zEKhdLlPfy+zbcZrunX1NHfDUY YvQYiJgHOK1WswYCkv/4pnQvYxzieuC9jmXkeNvnsh8rcyfgW/LBQmbXQBAZOF+6 9wjA54T08IBxGJi6lhXVIU3V5Z4RDjUifDox/P+Cp0u1Ero7W2hLptZVbYld/yjl Y8ZklD1gFJNQmmEdju5yUqLUcmWeoBULsLMmXsDjRZ3G6Ke8kzu323GlcISAyY0L ASS8UZgiSLMjjoAn3H4DmgO8hlLQIMfshTvzxnijgKRw1dzAvSWu7xBOlQGQcPz5 ZwH0YKsneTRlrCJJfIs6 =gMwJ -----END PGP SIGNATURE----- --=-y5TozUMfrKrJsE12RHl+-- --===============1055910068== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9kcmktZGV2ZWwK --===============1055910068==--