drm/i915/gvt: fix error handing of tlb_control emulation
authorChangbin Du <changbin.du@intel.com>
Tue, 27 Dec 2016 05:24:52 +0000 (13:24 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Mon, 9 Jan 2017 03:05:56 +0000 (11:05 +0800)
Return ealier for a invalid access, else it would false set
tlb flag for RCS.

Signed-off-by: Changbin Du <changbin.du@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/handlers.c

index 052e57124c0a57081f6f75f0ee68ad9392ca3f45..e06d5f37bb92d05d4c22456fc97cd8a7042391b4 100644 (file)
@@ -1367,7 +1367,6 @@ static int ring_mode_mmio_write(struct intel_vgpu *vgpu, unsigned int offset,
 static int gvt_reg_tlb_control_handler(struct intel_vgpu *vgpu,
                unsigned int offset, void *p_data, unsigned int bytes)
 {
-       int rc = 0;
        unsigned int id = 0;
 
        write_vreg(vgpu, offset, p_data, bytes);
@@ -1390,12 +1389,11 @@ static int gvt_reg_tlb_control_handler(struct intel_vgpu *vgpu,
                id = VECS;
                break;
        default:
-               rc = -EINVAL;
-               break;
+               return -EINVAL;
        }
        set_bit(id, (void *)vgpu->tlb_handle_pending);
 
-       return rc;
+       return 0;
 }
 
 static int ring_reset_ctl_write(struct intel_vgpu *vgpu,