Re: [PATCH v2] net: natsemi: ns83820: add checks for dma mapping error

2017-04-24 Thread David Miller
From: Alexey Khoroshilov Date: Sat, 22 Apr 2017 16:06:05 +0300 > + free_idx = (free_idx + NR_TX_DESC - 1) % NR_TX_DESC; This is more simply stated as "(free_idx - 1) % NR_TX_DESC.

Re: [PATCH v2] net: natsemi: ns83820: add checks for dma mapping error

2017-04-22 Thread Francois Romieu
Alexey Khoroshilov : [...] > diff --git a/drivers/net/ethernet/natsemi/ns83820.c > b/drivers/net/ethernet/natsemi/ns83820.c > index 729095db3e08..dfc64e1e31f9 100644 > --- a/drivers/net/ethernet/natsemi/ns83820.c > +++ b/drivers/net/ethernet/natsemi/ns83820.c [...] > @@ -1183,6 +1193,32 @@ static

[PATCH v2] net: natsemi: ns83820: add checks for dma mapping error

2017-04-22 Thread Alexey Khoroshilov
The driver does not check if mapping dma memory succeed. The patch adds the checks and failure handling. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/net/ethernet/natsemi/ns83820.c | 42 +++--- 1 file ch