Skip to content

Commit

Permalink
iscsi-target: remove dead code in iscsi_check_valuelist_for_support
Browse files Browse the repository at this point in the history
Neither "acceptor_values" nor "proposer_values" can be NULL here when
scanning the value lists for incoming iSCSI login parameters such as
HeaderDigest=CRC32C,None.

Smatch complains because we are not allowed to pass NULL pointers to
strchr().  Also I removed a second later check for "!acceptor_values"
because it gets checked on the next line in the do while condition.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Dan Carpenter authored and Nicholas Bellinger committed May 17, 2012
1 parent 8da1093 commit b1e41d8
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions drivers/target/iscsi/iscsi_target_parameters.c
Original file line number Diff line number Diff line change
Expand Up @@ -1037,13 +1037,6 @@ static char *iscsi_check_valuelist_for_support(
tmp2 = strchr(acceptor_values, ',');
if (tmp2)
*tmp2 = '\0';
if (!acceptor_values || !proposer_values) {
if (tmp1)
*tmp1 = ',';
if (tmp2)
*tmp2 = ',';
return NULL;
}
if (!strcmp(acceptor_values, proposer_values)) {
if (tmp2)
*tmp2 = ',';
Expand All @@ -1053,8 +1046,6 @@ static char *iscsi_check_valuelist_for_support(
*tmp2++ = ',';

acceptor_values = tmp2;
if (!acceptor_values)
break;
} while (acceptor_values);
if (tmp1)
*tmp1++ = ',';
Expand Down

0 comments on commit b1e41d8

Please sign in to comment.