[PATCH v2 1/5] drm/i915: Use kernel_write() in shmem object create

Chentaotao chentao325 at qq.com
Wed Jun 25 10:41:58 UTC 2025


在 2025/6/24 20:23, Matthew Wilcox 写道:
> On Tue, Jun 24, 2025 at 12:12:04PM +0000, 陈涛涛 Taotao Chen wrote:
>> +++ b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
>> @@ -637,8 +637,7 @@ i915_gem_object_create_shmem_from_data(struct drm_i915_private *i915,
>>   {
>>   	struct drm_i915_gem_object *obj;
>>   	struct file *file;
>> -	const struct address_space_operations *aops;
>> -	loff_t pos;
>> +	loff_t pos = 0;
>>   	int err;
> I think 'err' needs to become ssize_t to avoid writes larger than 2GB
> from being misinterpreted as errors.

Thanks for the great catch! I’ve changed int err; to ssize_t err; as you 
suggested.





More information about the dri-devel mailing list