intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jike Song <jike.song@intel.com>
To: intel-gvt-dev@lists.freedesktop.org, igvt-g-dev@ml01.01.org
Cc: intel-gfx@lists.freedesktop.org, dan.carpenter@oracle.com
Subject: [PATCH] drm/i915/gvt/kvmgt: remove useless code
Date: Thu, 26 Jan 2017 15:33:00 +0800	[thread overview]
Message-ID: <1485415980-2541-1-git-send-email-jike.song@intel.com> (raw)

As noticed by Dan, there is useless (and incorrect) code in kvmgt trying
to kfree(NULL), though almost harmless. It was a copy-paste mistake and
should be removed.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jike Song <jike.song@intel.com>
---
 drivers/gpu/drm/i915/gvt/kvmgt.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
index f0a993a..68737dc 100644
--- a/drivers/gpu/drm/i915/gvt/kvmgt.c
+++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
@@ -965,13 +965,7 @@ static long intel_vgpu_ioctl(struct mdev_device *mdev, unsigned int cmd,
 			sparse->areas[0].offset =
 					PAGE_ALIGN(vgpu_aperture_offset(vgpu));
 			sparse->areas[0].size = vgpu_aperture_sz(vgpu);
-			if (!caps.buf) {
-				kfree(caps.buf);
-				caps.buf = NULL;
-				caps.size = 0;
-			}
 			break;
-
 		case VFIO_PCI_BAR3_REGION_INDEX ... VFIO_PCI_BAR5_REGION_INDEX:
 			info.offset = VFIO_PCI_INDEX_TO_OFFSET(info.index);
 			info.size = 0;
@@ -979,7 +973,6 @@ static long intel_vgpu_ioctl(struct mdev_device *mdev, unsigned int cmd,
 			info.flags = 0;
 			gvt_dbg_core("get region info bar:%d\n", info.index);
 			break;
-
 		case VFIO_PCI_ROM_REGION_INDEX:
 		case VFIO_PCI_VGA_REGION_INDEX:
 			gvt_dbg_core("get region info index:%d\n", info.index);
-- 
2.4.4.488.gdf97e5d

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2017-01-26  7:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26  7:33 Jike Song [this message]
2017-01-26  8:25 ` ✗ Fi.CI.BAT: warning for drm/i915/gvt/kvmgt: remove useless code Patchwork

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=1485415980-2541-1-git-send-email-jike.song@intel.com \
    --to=jike.song@intel.com \
    --cc=dan.carpenter@oracle.com \
    --cc=igvt-g-dev@ml01.01.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    /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;
as well as URLs for NNTP newsgroup(s).