]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-fcloop: avoid possible uninitialized variable warning
authorJames Smart <jsmart2021@gmail.com>
Thu, 21 Dec 2017 22:15:47 +0000 (14:15 -0800)
committerChristoph Hellwig <hch@lst.de>
Fri, 29 Dec 2017 09:37:21 +0000 (10:37 +0100)
commit0ad7be748c7d177693f9c39cf931956bdb36e3b6
tree35c48cbe81577c5e43fe369032e9a2efa4c3c6b3
parentaf2ed2b0c7b7abe9603fc7dec1e7903662f39d44
nvme-fcloop: avoid possible uninitialized variable warning

The kbuild test robot send mail of a potential use of an uninitialized
variable - "tport" in fcloop_delete_targetport() which then calls
__targetport_unreg() which uses the variable. It will never be the
case it is uninitialized as the call to __targetport_unreg() only
occurs if there is a valid nport pointer. And at the time the nport
pointer is assigned, the tport variable is set.

Remove the warning by assigning a NULL value initially.

Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/fcloop.c