]> git.baikalelectronics.ru Git - kernel.git/commit
isdn: isdnloop: fix pointer dereference bug
authorArnd Bergmann <arnd@arndb.de>
Thu, 7 Mar 2019 09:32:07 +0000 (10:32 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 Mar 2019 17:25:52 +0000 (09:25 -0800)
commitdc412869163995b468f279230f535e0f183c91bb
treec3fcf93b74e64c544f804ae9e1006d996f074379
parent947ec81fe4facd0f51094e71c2da5fb07b89ade3
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>
drivers/isdn/isdnloop/isdnloop.c