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

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

 



On 12/13/2011 12:26 AM, Dan Carpenter wrote:
> 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.

<snip>

>    259		/*
>    260		 * This is currently the case for target_core_mod passthrough struct se_cmd
>    261		 * ops
>    262		 */
>    263		if (!sess || !tpg)
>                     ^^^^^
> Check.

Hi Dan,

I'd say we don't need to check sess.

Furthermore, this is different from the rest of the code when we have to
do something different for passthrough, we usually check
dev->transport->transport_type for TRANSPORT_PLUGIN_PHBA_PDEV instead of
this. I'm not up on this code, so maybe Nick or someone else can give a
better answer.

Regards -- Andy
--
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