[smatch stuff] target: uninitialized variable in iscsit_handle_text_cmd()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There is an uninitialized variable in iscsit_handle_text_cmd().  I'm
not sure why gcc doesn't complain...

drivers/target/iscsi/iscsi_target.c +1899 iscsit_handle_text_cmd(46)
	error: potentially derefencing uninitialized 'cmd'.

  1898                  if (padding != 0) {
  1899                          iov[niov].iov_base = cmd->pad_bytes;
                                                     ^^^^^

"cmd" hasn't been initialized here yet.

  1900                          iov[niov++].iov_len  = padding;
  1901                          rx_size += padding;
  1902                          pr_debug("Receiving %u additional bytes"
  1903                                          " for padding.\n", padding);
  1904                  }
  1905                  if (conn->conn_ops->DataDigest) {
  1906                          iov[niov].iov_base      = &checksum;
  1907                          iov[niov++].iov_len     = ISCSI_CRC_LEN;
  1908                          rx_size += ISCSI_CRC_LEN;
  1909                  }
  1910  
  1911                  rx_got = rx_data(conn, &iov[0], niov, rx_size);
  1912                  if (rx_got != rx_size) {
  1913                          kfree(text_in);
  1914                          return -1;
  1915                  }
  1916  
  1917                  if (conn->conn_ops->DataDigest) {
  1918                          iscsit_do_crypto_hash_buf(&conn->conn_rx_hash,
  1919                                          text_in, text_length,
  1920                                          padding, cmd->pad_bytes,
                                                         ^^^^^

Or here.

  1921                                          (u8 *)&data_crc);
  1922  

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux