Skip to content

Commit

Permalink
Overrun in drivers/char/rio/riocmd.c
Browse files Browse the repository at this point in the history
This got somehow lost in the noise.  This fixes coverity bug id torvalds#1025, if
Rup is greater or equal to MAX_RUP, we run past the Mapping Array.

Signed-off-by: Eric Sesterhenn <[email protected]>
Cc: Jiri Slaby <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
SesterhennEric authored and Linus Torvalds committed May 11, 2007
1 parent a12bb44 commit 84ea776
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/char/rio/riocmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, struc
rio_dprintk(RIO_DEBUG_CMD, "CONTROL information: Host number %Zd, name ``%s''\n", HostP - p->RIOHosts, HostP->Name);
rio_dprintk(RIO_DEBUG_CMD, "CONTROL information: Rup number 0x%x\n", rup);

if (Rup >= (unsigned short) MAX_RUP) {
if (Rup < (unsigned short) MAX_RUP) {
rio_dprintk(RIO_DEBUG_CMD, "CONTROL information: This is the RUP for RTA ``%s''\n", HostP->Mapping[Rup].Name);
} else
rio_dprintk(RIO_DEBUG_CMD, "CONTROL information: This is the RUP for link ``%c'' of host ``%s''\n", ('A' + Rup - MAX_RUP), HostP->Name);
Expand Down

0 comments on commit 84ea776

Please sign in to comment.