Skip to content

Commit 254beb8

Browse files
jsmart-ghChristoph Hellwig
authored andcommitted
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 <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 479a322 commit 254beb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvme/target/fcloop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ fcloop_delete_target_port(struct device *dev, struct device_attribute *attr,
10851085
const char *buf, size_t count)
10861086
{
10871087
struct fcloop_nport *nport = NULL, *tmpport;
1088-
struct fcloop_tport *tport;
1088+
struct fcloop_tport *tport = NULL;
10891089
u64 nodename, portname;
10901090
unsigned long flags;
10911091
int ret;

0 commit comments

Comments
 (0)