re: target: Follow up core updates from AGrover and HCH (round 4)

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

 



Hi Andy,

This isn't your code, but you might know...  Smatch complains that
we dereference "sess" before checking it.

drivers/target/target_core_pr.c +263 target_scsi2_reservation_reserve()
	 warn: variable dereferenced before check 'sess' (see line 248)

drivers/target/target_core_pr.c
   247		struct se_session *sess = cmd->se_sess;
   248		struct se_portal_group *tpg = sess->se_tpg;
                                              ^^^^^^^^^^^^
Dereference.

   249		int ret = 0;
   250	
   251		if ((cmd->t_task_cdb[1] & 0x01) &&
   252		    (cmd->t_task_cdb[1] & 0x02)) {
   253			pr_err("LongIO and Obselete Bits set, returning"
   254					" ILLEGAL_REQUEST\n");
   255			cmd->scsi_sense_reason = TCM_UNSUPPORTED_SCSI_OPCODE;
   256			ret = -EINVAL;
   257			goto out;
   258		}
   259		/*
   260		 * This is currently the case for target_core_mod passthrough struct se_cmd
   261		 * ops
   262		 */
   263		if (!sess || !tpg)
                    ^^^^^
Check.

   264			goto out;
   265		if (target_check_scsi2_reservation_conflict(cmd, &ret))

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