OSDN Git Service

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)
commit8a72b81e6df516847848556d0967aefa5457f11f
treec3fcf93b74e64c544f804ae9e1006d996f074379
parentf096ca63ca2a47a14892d1cf06cee99e78029541
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