re: target: Further refactoring of core_scsi3_emulate_pro_register()

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

 



Hello Andy Grover,

The patch bc118fe4c4a8: "target: Further refactoring of
core_scsi3_emulate_pro_register()" from May 16, 2013, leads to the
following static checker warning:

	drivers/target/target_core_pr.c:2177 core_scsi3_emulate_pro_register()
	warn: 'pr_reg' was already freed.

drivers/target/target_core_pr.c
  2161                   * Release the calling I_T Nexus registration now..
  2162                   */
  2163                  __core_scsi3_free_registration(cmd->se_dev, pr_reg, NULL, 1);
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Frees "pr_reg".

  2164  
  2165                  /*
  2166                   * From spc4r17, section 5.7.11.3 Unregistering
  2167                   *
  2168                   * If the persistent reservation is a registrants only
  2169                   * type, the device server shall establish a unit
  2170                   * attention condition for the initiator port associated
  2171                   * with every registered I_T nexus except for the I_T
  2172                   * nexus on which the PERSISTENT RESERVE OUT command was
  2173                   * received, with the additional sense code set to
  2174                   * RESERVATIONS RELEASED.
  2175                   */
  2176                  if (pr_holder &&
  2177                      (pr_reg->pr_res_type == PR_TYPE_WRITE_EXCLUSIVE_REGONLY ||
                             ^^^^^^^^^^^^^^^^^^^
  2178                       pr_reg->pr_res_type == PR_TYPE_EXCLUSIVE_ACCESS_REGONLY)) {
                             ^^^^^^^^^^^^^^^^^^^
Dereferences.

  2179                          list_for_each_entry(pr_reg_p,
  2180                                          &pr_tmpl->registration_list,
  2181                                          pr_reg_list) {

regards,
dan carpenter

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




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux