]> git.hungrycats.org Git - linux/commit
net: arc: fix the device for dma_map_single/dma_unmap_single
authorJohan Jonker <jbx6244@gmail.com>
Mon, 4 Nov 2024 13:01:38 +0000 (21:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Nov 2024 13:59:35 +0000 (14:59 +0100)
commit30606ea3fae57f8e9f2467415389e988e3c53a18
tree06dba3b005a33cee6900bd14ca9e982be4b59127
parent71d08334c2cb4132a2e6967130b9ae7bd1d6d16e
net: arc: fix the device for dma_map_single/dma_unmap_single

[ Upstream commit 71803c1dfa29e0d13b99e48fda11107cc8caebc7 ]

The ndev->dev and pdev->dev aren't the same device, use ndev->dev.parent
which has dma_mask, ndev->dev.parent is just pdev->dev.
Or it would cause the following issue:

[   39.933526] ------------[ cut here ]------------
[   39.938414] WARNING: CPU: 1 PID: 501 at kernel/dma/mapping.c:149 dma_map_page_attrs+0x90/0x1f8

Fixes: f959dcd6ddfd ("dma-direct: Fix potential NULL pointer dereference")
Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/arc/emac_main.c