* [PATCH] powerpc/ps3: use dma_mapping_error()
@ 2020-12-13 18:26 Vincent Stehlé
2020-12-13 19:38 ` Geoff Levand
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Vincent Stehlé @ 2020-12-13 18:26 UTC (permalink / raw)
To: linuxppc-dev, linux-kernel
Cc: Geoff Levand, Geert Uytterhoeven, Vincent Stehlé
The DMA address returned by dma_map_single() should be checked with
dma_mapping_error(). Fix the ps3stor_setup() function accordingly.
Fixes: 80071802cb9c ("[POWERPC] PS3: Storage Driver Core")
Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>
Cc: Geoff Levand <geoff@infradead.org>
Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
---
drivers/ps3/ps3stor_lib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ps3/ps3stor_lib.c b/drivers/ps3/ps3stor_lib.c
index 333ba83006e48..a12a1ad9b5fe3 100644
--- a/drivers/ps3/ps3stor_lib.c
+++ b/drivers/ps3/ps3stor_lib.c
@@ -189,7 +189,7 @@ int ps3stor_setup(struct ps3_storage_device *dev, irq_handler_t handler)
dev->bounce_lpar = ps3_mm_phys_to_lpar(__pa(dev->bounce_buf));
dev->bounce_dma = dma_map_single(&dev->sbd.core, dev->bounce_buf,
dev->bounce_size, DMA_BIDIRECTIONAL);
- if (!dev->bounce_dma) {
+ if (dma_mapping_error(&dev->sbd.core, dev->bounce_dma)) {
dev_err(&dev->sbd.core, "%s:%u: map DMA region failed\n",
__func__, __LINE__);
error = -ENODEV;
--
2.29.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/ps3: use dma_mapping_error()
2020-12-13 18:26 [PATCH] powerpc/ps3: use dma_mapping_error() Vincent Stehlé
@ 2020-12-13 19:38 ` Geoff Levand
2020-12-13 19:39 ` Geert Uytterhoeven
2020-12-21 11:03 ` Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: Geoff Levand @ 2020-12-13 19:38 UTC (permalink / raw)
To: Vincent Stehlé, linuxppc-dev, linux-kernel; +Cc: Geert Uytterhoeven
On 12/13/20 10:26 AM, Vincent Stehlé wrote:
> The DMA address returned by dma_map_single() should be checked with
> dma_mapping_error(). Fix the ps3stor_setup() function accordingly.
>
> Fixes: 80071802cb9c ("[POWERPC] PS3: Storage Driver Core")
> Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>
> Cc: Geoff Levand <geoff@infradead.org>
> Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
> ---
> drivers/ps3/ps3stor_lib.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Looks good. Thanks for submitting.
Acked by: Geoff Levand <geoff@infradead.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/ps3: use dma_mapping_error()
2020-12-13 18:26 [PATCH] powerpc/ps3: use dma_mapping_error() Vincent Stehlé
2020-12-13 19:38 ` Geoff Levand
@ 2020-12-13 19:39 ` Geert Uytterhoeven
2020-12-21 11:03 ` Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2020-12-13 19:39 UTC (permalink / raw)
To: Vincent Stehlé
Cc: Geoff Levand, Geert Uytterhoeven, linuxppc-dev,
Linux Kernel Mailing List
On Sun, Dec 13, 2020 at 8:06 PM Vincent Stehlé
<vincent.stehle@laposte.net> wrote:
> The DMA address returned by dma_map_single() should be checked with
> dma_mapping_error(). Fix the ps3stor_setup() function accordingly.
>
> Fixes: 80071802cb9c ("[POWERPC] PS3: Storage Driver Core")
> Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc/ps3: use dma_mapping_error()
2020-12-13 18:26 [PATCH] powerpc/ps3: use dma_mapping_error() Vincent Stehlé
2020-12-13 19:38 ` Geoff Levand
2020-12-13 19:39 ` Geert Uytterhoeven
@ 2020-12-21 11:03 ` Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2020-12-21 11:03 UTC (permalink / raw)
To: linuxppc-dev, Vincent Stehlé, linux-kernel
Cc: Geoff Levand, Geert Uytterhoeven
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 356 bytes --]
On Sun, 13 Dec 2020 19:26:22 +0100, Vincent Stehlé wrote:
> The DMA address returned by dma_map_single() should be checked with
> dma_mapping_error(). Fix the ps3stor_setup() function accordingly.
Applied to powerpc/next.
[1/1] powerpc/ps3: use dma_mapping_error()
https://git.kernel.org/powerpc/c/d0edaa28a1f7830997131cbce87b6c52472825d1
cheers
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-12-21 11:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-13 18:26 [PATCH] powerpc/ps3: use dma_mapping_error() Vincent Stehlé
2020-12-13 19:38 ` Geoff Levand
2020-12-13 19:39 ` Geert Uytterhoeven
2020-12-21 11:03 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).