Patch "octeon_ep: Add missing check for ioremap" has been added to the 6.1-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

    octeon_ep: Add missing check for ioremap

to the 6.1-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:
     octeon_ep-add-missing-check-for-ioremap.patch
and it can be found in the queue-6.1 subdirectory.

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



commit b4a784210dc88d58025c3d0a4b12b0493e54b549
Author: Jiasheng Jiang <jiasheng@xxxxxxxxxxx>
Date:   Thu Jun 15 11:34:00 2023 +0800

    octeon_ep: Add missing check for ioremap
    
    [ Upstream commit 9a36e2d44d122fe73a2a76ba73f1d50a65cf8210 ]
    
    Add check for ioremap() and return the error if it fails in order to
    guarantee the success of ioremap().
    
    Fixes: 862cd659a6fb ("octeon_ep: Add driver framework and device initialization")
    Signed-off-by: Jiasheng Jiang <jiasheng@xxxxxxxxxxx>
    Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230615033400.2971-1-jiasheng@xxxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
index b45dd7f04e213..8979dd05e873f 100644
--- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
+++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
@@ -928,6 +928,9 @@ int octep_device_setup(struct octep_device *oct)
 		oct->mmio[i].hw_addr =
 			ioremap(pci_resource_start(oct->pdev, i * 2),
 				pci_resource_len(oct->pdev, i * 2));
+		if (!oct->mmio[i].hw_addr)
+			goto unmap_prev;
+
 		oct->mmio[i].mapped = 1;
 	}
 
@@ -966,7 +969,9 @@ int octep_device_setup(struct octep_device *oct)
 	return 0;
 
 unsupported_dev:
-	for (i = 0; i < OCTEP_MMIO_REGIONS; i++)
+	i = OCTEP_MMIO_REGIONS;
+unmap_prev:
+	while (i--)
 		iounmap(oct->mmio[i].hw_addr);
 
 	kfree(oct->conf);



[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