mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 23:13:01 +02:00
powerpc: floppy: Add missing checks after DMA map
[ Upstream commit cf183c1730
]
The DMA map functions can fail and should be tested for errors.
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20250620075602.12575-1-fourier.thomas@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
b651248da7
commit
40c1baf8da
|
@ -144,9 +144,12 @@ static int hard_dma_setup(char *addr, unsigned long size, int mode, int io)
|
|||
bus_addr = 0;
|
||||
}
|
||||
|
||||
if (!bus_addr) /* need to map it */
|
||||
if (!bus_addr) { /* need to map it */
|
||||
bus_addr = dma_map_single(&isa_bridge_pcidev->dev, addr, size,
|
||||
dir);
|
||||
if (dma_mapping_error(&isa_bridge_pcidev->dev, bus_addr))
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* remember this one as prev */
|
||||
prev_addr = addr;
|
||||
|
|
Loading…
Reference in New Issue
Block a user