diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2019-03-07 04:32:07 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2019-03-07 12:25:52 -0500 |
| commit | 8a72b81e6df516847848556d0967aefa5457f11f (patch) | |
| tree | c3fcf93b74e64c544f804ae9e1006d996f074379 | |
| parent | f096ca63ca2a47a14892d1cf06cee99e78029541 (diff) | |
isdn: isdnloop: fix pointer dereference bug
clang has spotted an ancient code bug and warns about it with:
drivers/isdn/isdnloop/isdnloop.c:573:12: error: address of array 'card->rcard' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
This is an array of pointers, so we should check if a specific
pointer exists in the array before using it, not whether the
array itself exists.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | drivers/isdn/isdnloop/isdnloop.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/isdn/isdnloop/isdnloop.c b/drivers/isdn/isdnloop/isdnloop.c index f4253d468ae1..755c6bbc9553 100644 --- a/drivers/isdn/isdnloop/isdnloop.c +++ b/drivers/isdn/isdnloop/isdnloop.c | |||
| @@ -570,7 +570,7 @@ isdnloop_atimeout(isdnloop_card *card, int ch) | |||
| 570 | char buf[60]; | 570 | char buf[60]; |
| 571 | 571 | ||
| 572 | spin_lock_irqsave(&card->isdnloop_lock, flags); | 572 | spin_lock_irqsave(&card->isdnloop_lock, flags); |
| 573 | if (card->rcard) { | 573 | if (card->rcard[ch]) { |
| 574 | isdnloop_fake(card->rcard[ch], "DDIS_I", card->rch[ch] + 1); | 574 | isdnloop_fake(card->rcard[ch], "DDIS_I", card->rch[ch] + 1); |
| 575 | card->rcard[ch]->rcard[card->rch[ch]] = NULL; | 575 | card->rcard[ch]->rcard[card->rch[ch]] = NULL; |
| 576 | card->rcard[ch] = NULL; | 576 | card->rcard[ch] = NULL; |
