From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933191AbbI3Uzb (ORCPT ); Wed, 30 Sep 2015 16:55:31 -0400 Received: from mga01.intel.com ([192.55.52.88]:10346 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932915AbbI3UzZ (ORCPT ); Wed, 30 Sep 2015 16:55:25 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,614,1437462000"; d="scan'208";a="800836970" Date: Thu, 1 Oct 2015 04:54:47 +0800 From: kbuild test robot To: Rasmus Villemoes Cc: kbuild-all@01.org, David Airlie , Rasmus Villemoes , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] drm/vmwgfx: use kzalloc in vmw_surface_define_ioctl() Message-ID: <201510010454.nwCLjpXA%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1443642829-3590-1-git-send-email-linux@rasmusvillemoes.dk> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rasmus, [auto build test results on v4.3-rc3 -- if it's inappropriate base, please ignore] coccinelle warnings: (new ones prefixed by >>) >> drivers/gpu/drm/vmwgfx/vmwgfx_surface.c:771:1-13: alloc with no test, possible model on line 817 vim +771 drivers/gpu/drm/vmwgfx/vmwgfx_surface.c 543831cf Thomas Hellstrom 2012-11-20 765 543831cf Thomas Hellstrom 2012-11-20 766 srf->sizes = kmalloc(srf->num_sizes * sizeof(*srf->sizes), GFP_KERNEL); 543831cf Thomas Hellstrom 2012-11-20 767 if (unlikely(srf->sizes == NULL)) { 543831cf Thomas Hellstrom 2012-11-20 768 ret = -ENOMEM; 543831cf Thomas Hellstrom 2012-11-20 769 goto out_no_sizes; 543831cf Thomas Hellstrom 2012-11-20 770 } 543831cf Thomas Hellstrom 2012-11-20 @771 srf->offsets = kmalloc(srf->num_sizes * sizeof(*srf->offsets), 543831cf Thomas Hellstrom 2012-11-20 772 GFP_KERNEL); 543831cf Thomas Hellstrom 2012-11-20 773 if (unlikely(srf->sizes == NULL)) { 543831cf Thomas Hellstrom 2012-11-20 774 ret = -ENOMEM; 543831cf Thomas Hellstrom 2012-11-20 775 goto out_no_offsets; 543831cf Thomas Hellstrom 2012-11-20 776 } 543831cf Thomas Hellstrom 2012-11-20 777 543831cf Thomas Hellstrom 2012-11-20 778 user_sizes = (struct drm_vmw_size __user *)(unsigned long) 543831cf Thomas Hellstrom 2012-11-20 779 req->size_addr; 543831cf Thomas Hellstrom 2012-11-20 780 543831cf Thomas Hellstrom 2012-11-20 781 ret = copy_from_user(srf->sizes, user_sizes, 543831cf Thomas Hellstrom 2012-11-20 782 srf->num_sizes * sizeof(*srf->sizes)); 543831cf Thomas Hellstrom 2012-11-20 783 if (unlikely(ret != 0)) { 543831cf Thomas Hellstrom 2012-11-20 784 ret = -EFAULT; 543831cf Thomas Hellstrom 2012-11-20 785 goto out_no_copy; 543831cf Thomas Hellstrom 2012-11-20 786 } 543831cf Thomas Hellstrom 2012-11-20 787 543831cf Thomas Hellstrom 2012-11-20 788 srf->base_size = *srf->sizes; 543831cf Thomas Hellstrom 2012-11-20 789 srf->autogen_filter = SVGA3D_TEX_FILTER_NONE; 15c6f656 Zack Rusin 2012-11-21 790 srf->multisample_count = 0; 543831cf Thomas Hellstrom 2012-11-20 791 543831cf Thomas Hellstrom 2012-11-20 792 cur_bo_offset = 0; 543831cf Thomas Hellstrom 2012-11-20 793 cur_offset = srf->offsets; 543831cf Thomas Hellstrom 2012-11-20 794 cur_size = srf->sizes; 543831cf Thomas Hellstrom 2012-11-20 795 543831cf Thomas Hellstrom 2012-11-20 796 for (i = 0; i < DRM_VMW_MAX_SURFACE_FACES; ++i) { 543831cf Thomas Hellstrom 2012-11-20 797 for (j = 0; j < srf->mip_levels[i]; ++j) { 7e8d9da3 Thomas Hellstrom 2012-11-20 798 uint32_t stride = svga3dsurface_calculate_pitch 7e8d9da3 Thomas Hellstrom 2012-11-20 799 (desc, cur_size); 543831cf Thomas Hellstrom 2012-11-20 800 543831cf Thomas Hellstrom 2012-11-20 801 cur_offset->face = i; 543831cf Thomas Hellstrom 2012-11-20 802 cur_offset->mip = j; 543831cf Thomas Hellstrom 2012-11-20 803 cur_offset->bo_offset = cur_bo_offset; 7e8d9da3 Thomas Hellstrom 2012-11-20 804 cur_bo_offset += svga3dsurface_get_image_buffer_size 7e8d9da3 Thomas Hellstrom 2012-11-20 805 (desc, cur_size, stride); 543831cf Thomas Hellstrom 2012-11-20 806 ++cur_offset; 543831cf Thomas Hellstrom 2012-11-20 807 ++cur_size; 543831cf Thomas Hellstrom 2012-11-20 808 } 543831cf Thomas Hellstrom 2012-11-20 809 } 543831cf Thomas Hellstrom 2012-11-20 810 res->backup_size = cur_bo_offset; 543831cf Thomas Hellstrom 2012-11-20 811 if (srf->scanout && 543831cf Thomas Hellstrom 2012-11-20 812 srf->num_sizes == 1 && 543831cf Thomas Hellstrom 2012-11-20 813 srf->sizes[0].width == 64 && 543831cf Thomas Hellstrom 2012-11-20 814 srf->sizes[0].height == 64 && 543831cf Thomas Hellstrom 2012-11-20 815 srf->format == SVGA3D_A8R8G8B8) { 543831cf Thomas Hellstrom 2012-11-20 816 fc815f88 Rasmus Villemoes 2015-09-30 @817 srf->snooper.image = kzalloc(64 * 64 * 4, GFP_KERNEL); fc815f88 Rasmus Villemoes 2015-09-30 818 if (!srf->snooper.image) { 543831cf Thomas Hellstrom 2012-11-20 819 DRM_ERROR("Failed to allocate cursor_image\n"); 543831cf Thomas Hellstrom 2012-11-20 820 ret = -ENOMEM; :::::: The code at line 771 was first introduced by commit :::::: 543831cfc976669b8da963b3e94933e21e051846 drm/vmwgfx: Break out surface and context management to separate files :::::: TO: Thomas Hellstrom :::::: CC: Dave Airlie --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation