diff mbox

[v2] drm/i915/gvt/kvmgt: remove some dead code

Message ID 20170207145307.GA28648@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Feb. 7, 2017, 2:53 p.m. UTC
"caps.buf" is always NULL here and "caps.size" is always zero.  The code
is a no-op and can be removed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Joonas Lahtinen Feb. 8, 2017, 12:49 p.m. UTC | #1
On ti, 2017-02-07 at 17:53 +0300, Dan Carpenter wrote:
> "caps.buf" is always NULL here and "caps.size" is always zero.  The code
> is a no-op and can be removed.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

I assume Zhenyu will merge this through their tree.

Regards, Joonas
Zhenyu Wang Feb. 9, 2017, 1:40 a.m. UTC | #2
On 2017.02.08 14:49:22 +0200, Joonas Lahtinen wrote:
> On ti, 2017-02-07 at 17:53 +0300, Dan Carpenter wrote:
> > "caps.buf" is always NULL here and "caps.size" is always zero.  The code
> > is a no-op and can be removed.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> 
> I assume Zhenyu will merge this through their tree.
> 

yeah, already put in queue. Thanks!
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
index 3f656e3a6e5a..773a45aa18f8 100644
--- a/drivers/gpu/drm/i915/gvt/kvmgt.c
+++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
@@ -965,11 +965,6 @@  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: