Re: [PATCH v2 2/3] drm/amdgpu: Allow dma_map_sg() coalescing

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

 



On 4/27/2018 11:54 AM, Robin Murphy wrote:
> 
>> ubuntu@ubuntu:~/amdgpu$_./vectoradd_hip.exe
>> [  834.002206] create_process:620
>> [  837.413021] Unable to handle kernel NULL pointer dereference at virtual address 00000018
> 
> £5 says that's sg_dma_len(NULL), which implies either that something's gone horribly wrong with the scatterlist DMA mapping such that the lengths don't match, or much more likely that ttm.dma_address is NULL and I've missed the tiny subtlety below. Does that fix matters?

Turned out to be a null pointer problem after sg_next(). The following helped.

+               if (addrs && (dma_len == 0)) {
                        dma_sg = sg_next(dma_sg);
-                       dma_len = sg_dma_len(dma_sg);
-                       addr = sg_dma_address(dma_sg);
+                       if (dma_sg) {
+                               dma_len = sg_dma_len(dma_sg);
+                               addr = sg_dma_address(dma_sg);
+                       }
                }
 

-- 
Sinan Kaya
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux