tree:   git://people.freedesktop.org/~thomash/linux vmwgfx-next
head:   18e4a4669c5023eb1157f2a3f1bf6ca2b8535572
commit: 18e4a4669c5023eb1157f2a3f1bf6ca2b8535572 [1/1] drm/vmwgfx: Fix compat 
shader namespace

drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:482 vmw_cmd_res_reloc_add() warn: 
variable dereferenced before check 'p_val' (see line 448)

git remote add thomash git://people.freedesktop.org/~thomash/linux
git remote update thomash
git checkout 18e4a4669c5023eb1157f2a3f1bf6ca2b8535572
vim +/p_val +482 drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c

18e4a466 Thomas Hellstrom 2014-06-09  442                                struct 
vmw_resource *res,
18e4a466 Thomas Hellstrom 2014-06-09  443                                struct 
vmw_resource_val_node **p_val)
18e4a466 Thomas Hellstrom 2014-06-09  444  {
18e4a466 Thomas Hellstrom 2014-06-09  445       int ret;
18e4a466 Thomas Hellstrom 2014-06-09  446       struct vmw_resource_val_node 
*node;
18e4a466 Thomas Hellstrom 2014-06-09  447  
18e4a466 Thomas Hellstrom 2014-06-09 @448       *p_val = NULL;
18e4a466 Thomas Hellstrom 2014-06-09  449       ret = 
vmw_resource_relocation_add(&sw_context->res_relocations,
18e4a466 Thomas Hellstrom 2014-06-09  450                                       
  res,
18e4a466 Thomas Hellstrom 2014-06-09  451                                       
  id_loc - sw_context->buf_start);
18e4a466 Thomas Hellstrom 2014-06-09  452       if (unlikely(ret != 0))
18e4a466 Thomas Hellstrom 2014-06-09  453               goto out_err;
18e4a466 Thomas Hellstrom 2014-06-09  454  
18e4a466 Thomas Hellstrom 2014-06-09  455       ret = 
vmw_resource_val_add(sw_context, res, &node);
18e4a466 Thomas Hellstrom 2014-06-09  456       if (unlikely(ret != 0))
18e4a466 Thomas Hellstrom 2014-06-09  457               goto out_err;
18e4a466 Thomas Hellstrom 2014-06-09  458  
18e4a466 Thomas Hellstrom 2014-06-09  459       if (res_type == vmw_res_context 
&& dev_priv->has_mob &&
18e4a466 Thomas Hellstrom 2014-06-09  460           node->first_usage) {
18e4a466 Thomas Hellstrom 2014-06-09  461  
18e4a466 Thomas Hellstrom 2014-06-09  462               /*
18e4a466 Thomas Hellstrom 2014-06-09  463                * Put contexts first 
on the list to be able to exit
18e4a466 Thomas Hellstrom 2014-06-09  464                * list traversal for 
contexts early.
18e4a466 Thomas Hellstrom 2014-06-09  465                */
18e4a466 Thomas Hellstrom 2014-06-09  466               list_del(&node->head);
18e4a466 Thomas Hellstrom 2014-06-09  467               list_add(&node->head, 
&sw_context->resource_list);
18e4a466 Thomas Hellstrom 2014-06-09  468  
18e4a466 Thomas Hellstrom 2014-06-09  469               ret = 
vmw_resource_context_res_add(dev_priv, sw_context, res);
18e4a466 Thomas Hellstrom 2014-06-09  470               if (unlikely(ret != 0))
18e4a466 Thomas Hellstrom 2014-06-09  471                       goto out_err;
18e4a466 Thomas Hellstrom 2014-06-09  472               node->staged_bindings =
18e4a466 Thomas Hellstrom 2014-06-09  473                       
kzalloc(sizeof(*node->staged_bindings), GFP_KERNEL);
18e4a466 Thomas Hellstrom 2014-06-09  474               if 
(node->staged_bindings == NULL) {
18e4a466 Thomas Hellstrom 2014-06-09  475                       
DRM_ERROR("Failed to allocate context binding "
18e4a466 Thomas Hellstrom 2014-06-09  476                                 
"information.\n");
18e4a466 Thomas Hellstrom 2014-06-09  477                       goto out_err;
18e4a466 Thomas Hellstrom 2014-06-09  478               }
18e4a466 Thomas Hellstrom 2014-06-09  479               
INIT_LIST_HEAD(&node->staged_bindings->list);
18e4a466 Thomas Hellstrom 2014-06-09  480       }
18e4a466 Thomas Hellstrom 2014-06-09  481  
18e4a466 Thomas Hellstrom 2014-06-09 @482       if (p_val)
18e4a466 Thomas Hellstrom 2014-06-09  483               *p_val = node;
18e4a466 Thomas Hellstrom 2014-06-09  484  
18e4a466 Thomas Hellstrom 2014-06-09  485  out_err:

---
0-DAY kernel build testing backend              Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation
_______________________________________________
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild

Reply via email to