lkml.org 
[lkml]   [2023]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: drivers/pci/p2pdma.c:199:44: sparse: sparse: dereference of noderef expression


On 2023-02-06 8:26 a.m., Chaitanya Kulkarni wrote:
> Logan,
>
>> If you fix the issue, kindly add following tag where applicable
>> | Reported-by: kernel test robot <lkp@intel.com>
>>
>> sparse warnings: (new ones prefixed by >>)
>>>> drivers/pci/p2pdma.c:199:44: sparse: sparse: dereference of noderef expression
>>
>> vim +199 drivers/pci/p2pdma.c
>>
>> 193
>> 194 static void p2pdma_page_free(struct page *page)
>> 195 {
>> 196 struct pci_p2pdma_pagemap *pgmap = to_p2p_pgmap(page->pgmap);
>> 197 struct percpu_ref *ref;
>> 198
>> > 199 gen_pool_free_owner(pgmap->provider->p2pdma->pool,
>> 200 (uintptr_t)page_to_virt(page), PAGE_SIZE,
>> 201 (void **)&ref);
>> 202 percpu_ref_put(ref);
>> 203 }
>> 204
>>
>
> Did you get a chance to look into this ?

Oh, I didn't notice that email. Wonder why it took this long for sparse
to see that.

Looks like we need to add a rcu_derference_protected() around the p2pdma
dereference there. I can send a patch later this week.

Thanks,

Logan

\
 
 \ /
  Last update: 2023-03-27 00:11    [W:0.052 / U:1.664 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site