i965: Fix strerror error code sign
authorMark Janes <mark.a.janes@intel.com>
Thu, 19 May 2016 20:42:16 +0000 (13:42 -0700)
committerMark Janes <mark.a.janes@intel.com>
Fri, 20 May 2016 12:58:18 +0000 (05:58 -0700)
This trivial fix to error-handling corrects the sign of drm error
codes before passing them to strerror.

Identified by Coverity: CID1358581

src/mesa/drivers/dri/i965/intel_screen.c

index 1a0541a6c7ca3a27682a81387b4c2ab41ff38be8..076fa24cd6f2ae96aeb96c643845f11bb39ee41b 100644 (file)
@@ -1111,7 +1111,7 @@ intel_detect_sseu(struct intel_screen *intelScreen)
 err_out:
    intelScreen->subslice_total = -1;
    intelScreen->eu_total = -1;
-   _mesa_warning(NULL, "Failed to query GPU properties (%s).\n", strerror(ret));
+   _mesa_warning(NULL, "Failed to query GPU properties (%s).\n", strerror(-ret));
 }
 
 static bool