Skip to content

Commit

Permalink
rapidio/tsi721: fix incorrect detection of address translation condition
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Alexandre Bounine authored and torvalds committed Sep 2, 2016
1 parent 1e1011a commit b300692
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/rapidio/devices/tsi721.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b300692

Please sign in to comment.