mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-30 21:42:06 -06:00
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>
This commit is contained in:
parent
277263e1b3
commit
532cee4184
1 changed files with 1 additions and 1 deletions
|
@ -1326,7 +1326,7 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iscsi_url->user != NULL) {
|
if (iscsi_url->user[0] != '\0') {
|
||||||
ret = iscsi_set_initiator_username_pwd(iscsi, iscsi_url->user,
|
ret = iscsi_set_initiator_username_pwd(iscsi, iscsi_url->user,
|
||||||
iscsi_url->passwd);
|
iscsi_url->passwd);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue