mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 14:19:09 -04:00
usb: u_qdss: Add proper error handling for map failure of iova
dma_map_resource() API returns DMA_MAPPING_ERROR i.e -1 upon error. The current code checks against NULL which makes it think that the API returned successfully. The incorrect IOVA further results into SMMU fault. To fix this, add proper error handling for mapping failure of iova. Change-Id: I080049029ce01be13c603a1d709e37189a09484e Signed-off-by: Rohith Kollalsi <quic_rkollals@quicinc.com>
This commit is contained in:
parent
62da00618b
commit
7acc156970
1 changed files with 1 additions and 1 deletions
|
|
@ -73,7 +73,7 @@ int set_qdss_data_connection(struct f_qdss *qdss, int enable)
|
|||
bam_info.qdss_bam_iova = dma_map_resource(dev->parent,
|
||||
bam_info.qdss_bam_phys, bam_info.qdss_bam_size,
|
||||
DMA_BIDIRECTIONAL, 0);
|
||||
if (!bam_info.qdss_bam_iova) {
|
||||
if (dma_mapping_error(dev, bam_info.qdss_bam_iova)) {
|
||||
pr_err("dma_map_resource failed\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue