From: kbuild test robot <lkp@intel.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: kbuild-all@01.org, David Airlie <airlied@linux.ie>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] drm/vmwgfx: use kzalloc in vmw_surface_define_ioctl()
Date: Thu, 1 Oct 2015 04:54:47 +0800 [thread overview]
Message-ID: <201510010454.nwCLjpXA%fengguang.wu@intel.com> (raw)
In-Reply-To: <1443642829-3590-1-git-send-email-linux@rasmusvillemoes.dk>
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 <thellstrom@vmware.com>
:::::: CC: Dave Airlie <airlied@redhat.com>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
next prev parent reply other threads:[~2015-09-30 20:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-30 19:53 Rasmus Villemoes
2015-09-30 19:53 ` [PATCH 2/2] drm/omap: use kzalloc in sita_init() Rasmus Villemoes
2015-09-30 20:54 ` kbuild test robot [this message]
2015-09-30 21:08 ` [PATCH 1/2] drm/vmwgfx: use kzalloc in vmw_surface_define_ioctl() Rasmus Villemoes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201510010454.nwCLjpXA%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=kbuild-all@01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®