aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Bounine <[email protected]>2016-09-01 16:15:18 -0700
committerLinus Torvalds <[email protected]>2016-09-01 17:52:02 -0700
commitb30069291dc7f9b9a073c33d619818fe4a8e50de (patch)
treedd238ac85a430efd89874b7457e4da1e04cfc865
parent1e1011af7a5725141aa4c8d30132acd93fe3da4e (diff)
rapidio/tsi721: fix incorrect detection of address translation condition
Fix incorrect condition to identify involvment of a address translation mechanism. This bug results in NULL pointer kernel crash dump in cases when mapping of inbound RapidIO address range is requested within existing aprture. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Alexandre Bounine <[email protected]> Cc: Matt Porter <[email protected]> Cc: Andre van Herk <[email protected]> Cc: Barry Wood <[email protected]> Cc: <[email protected]> [4.6+] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--drivers/rapidio/devices/tsi721.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c
index 32f0f014a067..9d19b9a62011 100644
--- a/drivers/rapidio/devices/tsi721.c
+++ b/drivers/rapidio/devices/tsi721.c
@@ -1161,7 +1161,7 @@ static int tsi721_rio_map_inb_mem(struct rio_mport *mport, dma_addr_t lstart,
} else if (ibw_start < (ib_win->rstart + ib_win->size) &&
(ibw_start + ibw_size) > ib_win->rstart) {
/* Return error if address translation involved */
- if (direct && ib_win->xlat) {
+ if (!direct || ib_win->xlat) {
ret = -EFAULT;
break;
}