Commit 561aa0e
nui: Fix dma_mapping_error() check
dma_map_XXX() functions return values DMA_MAPPING_ERROR as error values
which is often ~0. The error value should be tested with
dma_mapping_error().
This patch creates a new function in niu_ops to test if the mapping
failed. The test is fixed in niu_rbr_add_page(), added in
niu_start_xmit() and the successfully mapped pages are unmaped upon error.
Fixes: ec2deec ("niu: Fix to check for dma mapping errors.")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent 34a500c commit 561aa0e
2 files changed
Lines changed: 34 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3336 | 3336 | | |
3337 | 3337 | | |
3338 | 3338 | | |
3339 | | - | |
| 3339 | + | |
3340 | 3340 | | |
3341 | 3341 | | |
3342 | 3342 | | |
| |||
6676 | 6676 | | |
6677 | 6677 | | |
6678 | 6678 | | |
| 6679 | + | |
| 6680 | + | |
6679 | 6681 | | |
6680 | 6682 | | |
6681 | 6683 | | |
| |||
6717 | 6719 | | |
6718 | 6720 | | |
6719 | 6721 | | |
| 6722 | + | |
| 6723 | + | |
6720 | 6724 | | |
6721 | 6725 | | |
6722 | 6726 | | |
| |||
6741 | 6745 | | |
6742 | 6746 | | |
6743 | 6747 | | |
| 6748 | + | |
| 6749 | + | |
| 6750 | + | |
| 6751 | + | |
| 6752 | + | |
| 6753 | + | |
| 6754 | + | |
| 6755 | + | |
| 6756 | + | |
| 6757 | + | |
| 6758 | + | |
| 6759 | + | |
| 6760 | + | |
6744 | 6761 | | |
6745 | 6762 | | |
6746 | 6763 | | |
| |||
9644 | 9661 | | |
9645 | 9662 | | |
9646 | 9663 | | |
| 9664 | + | |
| 9665 | + | |
| 9666 | + | |
| 9667 | + | |
| 9668 | + | |
9647 | 9669 | | |
9648 | 9670 | | |
9649 | 9671 | | |
9650 | 9672 | | |
9651 | 9673 | | |
9652 | 9674 | | |
9653 | 9675 | | |
| 9676 | + | |
9654 | 9677 | | |
9655 | 9678 | | |
9656 | 9679 | | |
| |||
10019 | 10042 | | |
10020 | 10043 | | |
10021 | 10044 | | |
| 10045 | + | |
| 10046 | + | |
| 10047 | + | |
| 10048 | + | |
| 10049 | + | |
10022 | 10050 | | |
10023 | 10051 | | |
10024 | 10052 | | |
10025 | 10053 | | |
10026 | 10054 | | |
10027 | 10055 | | |
10028 | 10056 | | |
| 10057 | + | |
10029 | 10058 | | |
10030 | 10059 | | |
10031 | 10060 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2879 | 2879 | | |
2880 | 2880 | | |
2881 | 2881 | | |
| 2882 | + | |
| 2883 | + | |
| 2884 | + | |
2882 | 2885 | | |
2883 | 2886 | | |
2884 | 2887 | | |
| |||
3140 | 3143 | | |
3141 | 3144 | | |
3142 | 3145 | | |
| 3146 | + | |
3143 | 3147 | | |
3144 | 3148 | | |
3145 | 3149 | | |
| |||
0 commit comments