lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <7e8798e6-36ac-4f26-0a12-c9d6fb302bac@infradead.org> Date: Sat, 25 Feb 2023 16:16:45 -0800 From: Geoff Levand <geoff@...radead.org> To: Alexander Lobakin <alexandr.lobakin@...el.com> Cc: Jakub Kicinski <kuba@...nel.org>, "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org Subject: Re: [PATCH net v5 2/2] net/ps3_gelic_net: Use dma_mapping_error Hi, On 2/14/23 09:28, Alexander Lobakin wrote: > From: Geoff Levand <geoff@...radead.org> > Date: Sun, 12 Feb 2023 18:00:58 +0000 > >> The current Gelic Etherenet driver was checking the return value of its >> dma_map_single call, and not using the dma_mapping_error() routine. >> >> Fixes runtime problems like these: >> >> DMA-API: ps3_gelic_driver sb_05: device driver failed to check map error >> WARNING: CPU: 0 PID: 0 at kernel/dma/debug.c:1027 .check_unmap+0x888/0x8dc >> >> Fixes: 02c1889166b4 (ps3: gigabit ethernet driver for PS3, take3) >> Signed-off-by: Geoff Levand <geoff@...radead.org> >> --- >> drivers/net/ethernet/toshiba/ps3_gelic_net.c | 41 ++++++++++---------- >> 1 file changed, 20 insertions(+), 21 deletions(-) >> >> diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_net.c b/drivers/net/ethernet/toshiba/ps3_gelic_net.c >> index 2bb68e60d0d5..0e52bb99e344 100644 >> --- a/drivers/net/ethernet/toshiba/ps3_gelic_net.c >> +++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.c >> - if (!descr->bus_addr) >> - goto iommu_error; >> + if (unlikely(dma_mapping_error(dev, descr->bus_addr))) { > > dma_mapping_error() already has unlikely() inside. OK, I'll remove that in the next patch set. >> + dev_err(dev, "%s:%d: dma_mapping_error\n", __func__, >> + __LINE__); > It is fast path. You're not allowed to use plain printk on fast path, > since you may generate then thousands of messages per second. > Consider looking at _ratelimit family of functions. OK, I'll fix that. Thanks for the review. -Geoff
Powered by blists - more mailing lists