]> git.baikalelectronics.ru Git - kernel.git/commit
isdn: kcapi: avoid uninitialized data
authorArnd Bergmann <arnd@arndb.de>
Tue, 28 Mar 2017 10:11:07 +0000 (12:11 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Mar 2017 00:59:33 +0000 (17:59 -0700)
commitcd7df958bfe866e6c50dd862a19e4e3a996f1308
tree541012599a12ad8d7eff411a1b567cbd316b07fd
parente1bed9386f630c3e5c160decadc2ea3c3ec04236
isdn: kcapi: avoid uninitialized data

gcc-7 points out that the AVMB1_ADDCARD ioctl results in an unintialized
value ending up in the cardnr parameter:

drivers/isdn/capi/kcapi.c: In function 'old_capi_manufacturer':
drivers/isdn/capi/kcapi.c:1042:24: error: 'cdef.cardnr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   cparams.cardnr = cdef.cardnr;

This has been broken since before the start of the git history, so
either the value is not used for anything important, or the ioctl
command doesn't get called in practice.

Setting the cardnr to zero avoids the warning and makes sure
we have consistent behavior.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/isdn/capi/kcapi.c