]> www.infradead.org Git - users/dwmw2/linux.git/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)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 7 Nov 2024 12:39:42 +0000 (13:39 +0100)
commit71803c1dfa29e0d13b99e48fda11107cc8caebc7
tree9500d250beeb3eb099b364fb7c1290c0e5840c84
parent5d182f711ecc80b085f73c7bdd49fc65c886ac69
net: arc: fix the device for dma_map_single/dma_unmap_single

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>
drivers/net/ethernet/arc/emac_main.c