st/mesa: properly handle u_upload_alloc failure
[mesa.git] / src / mesa / state_tracker / st_cb_drawtex.c
index 2af4f6d4cf63e44c60fb6ff3e483be09a70dbfab..2634b09d777971e815007256d9f10f1f0b85e38d 100644 (file)
@@ -149,9 +149,10 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
       GLfloat *vbuf = NULL;
       GLuint attr;
 
-      if (u_upload_alloc(st->uploader, 0,
-                         numAttribs * 4 * 4 * sizeof(GLfloat),
-                         &offset, &vbuffer, (void **) &vbuf) != PIPE_OK) {
+      u_upload_alloc(st->uploader, 0,
+                     numAttribs * 4 * 4 * sizeof(GLfloat),
+                     &offset, &vbuffer, (void **) &vbuf);
+      if (!vbuffer) {
          return;
       }