Patch "iommu/omap: Check for failure of a call to omap_iommu_dump_ctx" has been added to the 4.4-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    iommu/omap: Check for failure of a call to omap_iommu_dump_ctx

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     iommu-omap-check-for-failure-of-a-call-to-omap_iommu.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit f69fdc720455fed3408c77227d7f156c52ce19d5
Author: Colin Ian King <colin.king@xxxxxxxxxxxxx>
Date:   Tue Jul 14 20:22:11 2020 +0100

    iommu/omap: Check for failure of a call to omap_iommu_dump_ctx
    
    [ Upstream commit dee9d154f40c58d02f69acdaa5cfd1eae6ebc28b ]
    
    It is possible for the call to omap_iommu_dump_ctx to return
    a negative error number, so check for the failure and return
    the error number rather than pass the negative value to
    simple_read_from_buffer.
    
    Fixes: 14e0e6796a0d ("OMAP: iommu: add initial debugfs support")
    Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20200714192211.744776-1-colin.king@xxxxxxxxxxxxx
    Addresses-Coverity: ("Improper use of negative value")
    Signed-off-by: Joerg Roedel <jroedel@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/iommu/omap-iommu-debug.c b/drivers/iommu/omap-iommu-debug.c
index 9bc20e2119a35..82bf208295f4b 100644
--- a/drivers/iommu/omap-iommu-debug.c
+++ b/drivers/iommu/omap-iommu-debug.c
@@ -101,8 +101,11 @@ static ssize_t debug_read_regs(struct file *file, char __user *userbuf,
 	mutex_lock(&iommu_debug_lock);
 
 	bytes = omap_iommu_dump_ctx(obj, p, count);
+	if (bytes < 0)
+		goto err;
 	bytes = simple_read_from_buffer(userbuf, count, ppos, buf, bytes);
 
+err:
 	mutex_unlock(&iommu_debug_lock);
 	kfree(buf);
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux