diff options
author | Stefan Weil <sw@weilnetz.de> | 2015-03-07 10:14:30 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-03-10 10:49:25 +0100 |
commit | 532cee4184877053398a2bdae4edc965084fc79e (patch) | |
tree | 0d0420132f9255b7e4cbdb2c5153a7657bae8f03 /block/iscsi.c | |
parent | 277263e1b320d759a760ba6c5ea75ec268f929e5 (diff) |
iscsi: Fix check for username
The variable user in struct iscsi_url is a character array, not a pointer.
Therefore its address will never be NULL.
clang reports this error:
block/iscsi.c:1329:20: warning:
comparison of array 'iscsi_url->user' not equal to a null pointer
is always true [-Wtautological-pointer-compare]
Reviewed-by: Peter Lieven <pl@kamp.de>
Acked-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Message-Id: <1425719670-5486-1-git-send-email-sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'block/iscsi.c')
-rw-r--r-- | block/iscsi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/iscsi.c b/block/iscsi.c index 1fa855acdd..3e34b1f3a2 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -1326,7 +1326,7 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags, goto out; } - if (iscsi_url->user != NULL) { + if (iscsi_url->user[0] != '\0') { ret = iscsi_set_initiator_username_pwd(iscsi, iscsi_url->user, iscsi_url->passwd); if (ret != 0) { |