Skip to content

Commit

Permalink
staging/fwserial: Use WARN_ONCE when port table is corrupted
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Peter Hurley authored and Greg Kroah-Hartman committed Nov 28, 2012
1 parent a321846 commit 49b2746
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions drivers/staging/fwserial/fwserial.c
Original file line number Diff line number Diff line change
@@ -939,14 +939,9 @@ static void fwserial_destroy(struct kref *kref)

mutex_lock(&port_table_lock);
for (j = 0; j < num_ports; ++i, ++j) {
static bool once;
int corrupt = port_table[i] != ports[j];
if (corrupt && !once) {
WARN(corrupt, "port_table[%d]: %p != ports[%d]: %p",
i, port_table[i], j, ports[j]);
once = true;
port_table_corrupt = true;
}
port_table_corrupt |= port_table[i] != ports[j];
WARN_ONCE(port_table_corrupt, "port_table[%d]: %p != ports[%d]: %p",
i, port_table[i], j, ports[j]);

port_table[i] = NULL;
}

0 comments on commit 49b2746

Please sign in to comment.