diff options
| author | Jonathan Cavitt <jonathan.cavitt@intel.com> | 2025-09-23 21:23:33 +0000 |
|---|---|---|
| committer | Andi Shyti <andi.shyti@linux.intel.com> | 2025-09-26 00:27:54 +0200 |
| commit | 22a2f2e35f9c08c8572003d1e6d3f0e9ab968837 (patch) | |
| tree | 9c13bd5ff19b2b51d472bcd7419da89f9ceaaf93 /tools/perf/scripts/python/netdev-times.py | |
| parent | 69b4d367fff6d311da6e3ce1b8b34b3e37b59b5a (diff) | |
| download | linux-22a2f2e35f9c08c8572003d1e6d3f0e9ab968837.tar.gz linux-22a2f2e35f9c08c8572003d1e6d3f0e9ab968837.zip | |
drm/i915/gvt: Improve intel_vgpu_ioctl hdr error handling
Add error handling for the following VFIO_DEVICE_SET_IRQS cases with
respect to the hdr struct:
- More than one VFIO_IRQ_DATA_TYPE_MASK flag is set in hdr.flags
- More than one VFIO_IRQ_ACTION_TYPE_MASK flag is set in hdr.flags
- hdr.count is not specified
Note that since hdr.count != 0, data_size != 0 is guaranteed unless
vfio_set_irqs_validate_and_prepare fails and returns an error. So, we
no longer need to check data_size before running memdup_user because
checking the return value of the function is sufficient.
v2: Use correct name for mask
v3: Use is_power_of_2 over hweight32 as it's more efficient (Andi)
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Cc: Andi Shyti <andi.shyti@linux.intel.com>
Reviewed-by: Zhenyu Wang <zhenyuw.linux@gmail.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://lore.kernel.org/r/20250923212332.112137-2-jonathan.cavitt@intel.com
Diffstat (limited to 'tools/perf/scripts/python/netdev-times.py')
0 files changed, 0 insertions, 0 deletions
