On Fri, Feb 17, 2012 at 12:39 PM, Jörn Engel <joern@xxxxxxxxx> wrote:
> Afaics the assignment does not need to be protected by ha->tgt_mutex and
> we definitely should check for NULL before dereferencing sess.
>
> Signed-off-by: Joern Engel <joern@xxxxxxxxx>
> ---
> drivers/scsi/qla2xxx/qla_target.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
> index ac203ef..4bbfa88 100644
> --- a/drivers/scsi/qla2xxx/qla_target.c
> +++ b/drivers/scsi/qla2xxx/qla_target.c
> @@ -2586,12 +2586,12 @@ static void qla_tgt_do_work(struct work_struct *work)
>
> mutex_lock(&ha->tgt_mutex);
> cmd->sess = sess = qla_tgt_make_local_sess(vha, s_id, loop_id);
> - cmd->loop_id = sess->loop_id;
> /* sess has got an extra creation ref */
> mutex_unlock(&ha->tgt_mutex);
>
> if (!sess)
> goto out_term;
> + cmd->loop_id = sess->loop_id;
Good catch... maybe it's cleaner if we just use the loop_id local variable we
already have anyway? (Not that it really matters either way)
--
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
[Linux SCSI]
[Kernel Newbies]
[Linux SCSI Target Infrastructure]
[Share Photos]
[IDE]
[Security]
[Git]
[Netfilter]
[Bugtraq]
[Photos]
[Yosemite]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Linux ATA RAID]
[Linux IIO]
[Samba]
[Video 4 Linux]
[Device Mapper]
[Linux Resources]