Re: [PATCH CI] drm/i915: Initialize err in remap_io_sg()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 17 May 2021, "Souza, Jose" <jose.souza@xxxxxxxxx> wrote:
> Rodrigo, Jani: So "i915: fix remap_io_sg to verify the pgprot" was not merged into any drm-intel branch, how should I merge this after get CI green
> light?

I think Rodrigo should do a backmerge.

BR,
Jani.


>
> On Mon, 2021-05-17 at 13:21 -0700, José Roberto de Souza wrote:
>> If the do while loop breaks in 'if (!sg_dma_len(sgl))' in the first
>> iteration, err is uninitialized causing a wrong call to zap_vma_ptes().
>> 
>> But that is impossible to happen as a scatterlist must have at least
>> one valid segment.
>> Anyways to avoid more reports from static checkers initializing ret
>> here.
>> 
>> Fixes: b12d691ea5e0 ("i915: fix remap_io_sg to verify the pgprot")
>> Reviewed-by: Christoph Hellwig <hch@xxxxxx>
>> Cc: Christoph Hellwig <hch@xxxxxx>
>> Signed-off-by: James Ausmus <james.ausmus@xxxxxxxxx>
>> Signed-off-by: José Roberto de Souza <jose.souza@xxxxxxxxx>
>> ---
>>  drivers/gpu/drm/i915/i915_mm.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c
>> index 4c8cd08c672d..25576fa73ff0 100644
>> --- a/drivers/gpu/drm/i915/i915_mm.c
>> +++ b/drivers/gpu/drm/i915/i915_mm.c
>> @@ -47,7 +47,7 @@ int remap_io_sg(struct vm_area_struct *vma,
>>  		struct scatterlist *sgl, resource_size_t iobase)
>>  {
>>  	unsigned long pfn, len, remapped = 0;
>> -	int err;
>> +	int err = 0;
>>  
>>  	/* We rely on prevalidation of the io-mapping to skip track_pfn(). */
>>  	GEM_BUG_ON((vma->vm_flags & EXPECTED_FLAGS) != EXPECTED_FLAGS);
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux