[PATCH 1/1] drm/vmwgfx: avoid possible NULL pointer dereference

kbuild test robot lkp at intel.com
Tue Aug 23 14:05:14 UTC 2016


Hi Heinrich,

[auto build test WARNING on drm/drm-next]
[also build test WARNING on v4.8-rc3 next-20160823]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:    https://github.com/0day-ci/linux/commits/Heinrich-Schuchardt/drm-vmwgfx-avoid-possible-NULL-pointer-dereference/20160822-051807
base:   git://people.freedesktop.org/~airlied/linux.git drm-next
config: x86_64-randconfig-x016-201634 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c: In function 'vmw_cmd_res_reloc_add':
>> drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:656:3: warning: 'return' with no value, in function returning non-void [-Wreturn-type]
      return;
      ^~~~~~
   drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:646:12: note: declared here
    static int vmw_cmd_res_reloc_add(struct vmw_private *dev_priv,
               ^~~~~~~~~~~~~~~~~~~~~

vim +/return +656 drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c

   640	 * @sw_context: Pointer to the software context.
   641	 * @id_loc: Pointer to where the id that needs translation is located.
   642	 * @res: Valid pointer to a struct vmw_resource.
   643	 * @p_val: If non null, a pointer to the struct vmw_resource_validate_node
   644	 * used for this resource is returned here.
   645	 */
   646	static int vmw_cmd_res_reloc_add(struct vmw_private *dev_priv,
   647					 struct vmw_sw_context *sw_context,
   648					 uint32_t *id_loc,
   649					 struct vmw_resource *res,
   650					 struct vmw_resource_val_node **p_val)
   651	{
   652		int ret;
   653		struct vmw_resource_val_node *node;
   654	
   655		if (!p_val)
 > 656			return;
   657	
   658		*p_val = NULL;
   659	
   660		ret = vmw_resource_relocation_add(&sw_context->res_relocations,
   661						  res,
   662						  id_loc - sw_context->buf_start);
   663		if (unlikely(ret != 0))
   664			return ret;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/octet-stream
Size: 32267 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160823/11424178/attachment-0001.obj>


More information about the dri-devel mailing list