summaryrefslogtreecommitdiff
path: root/arch/powerpc
diff options
context:
space:
mode:
authorThomas Fourier <fourier.thomas@gmail.com>2025-06-20 09:55:55 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-08-28 16:28:23 +0200
commit88517afa7401a088875f5f068aba0624ddb90aaf (patch)
tree5160d2a635e17a4c5981cd1099b69fac8e23a192 /arch/powerpc
parenteb1e1526b82b8cf31f1ef9ca86a2647fb6cd89c6 (diff)
downloadlinux-88517afa7401a088875f5f068aba0624ddb90aaf.tar.gz
linux-88517afa7401a088875f5f068aba0624ddb90aaf.tar.bz2
linux-88517afa7401a088875f5f068aba0624ddb90aaf.zip
powerpc: floppy: Add missing checks after DMA map
[ Upstream commit cf183c1730f2634245da35e9b5d53381b787d112 ] 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>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/include/asm/floppy.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/floppy.h b/arch/powerpc/include/asm/floppy.h
index f8ce178b43b7..34abf8bea2cc 100644
--- a/arch/powerpc/include/asm/floppy.h
+++ b/arch/powerpc/include/asm/floppy.h
@@ -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;