Re: [patch 2/2] zfcp: Add FC pass-through support

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

 



On Mon, 06 Apr 2009 18:31:47 +0200
Christof Schmitt <christof.schmitt@xxxxxxxxxx> wrote:
> +	els_fc_job->els.adapter = adapter;
> +	if (rport) {
> +		read_lock_irq(&zfcp_data.config_lock);
> +		port = rport->dd_data;
> +		if (port)
> +			zfcp_port_get(port);
> +		read_unlock_irq(&zfcp_data.config_lock);
> +		if (!port) {
> +			kfree(els_fc_job);
> +			return -EINVAL;
> +		}
> +		els_fc_job->els.port = port;
> +		els_fc_job->els.d_id = port->d_id;
> +		zfcp_port_put(port);
> +	} else {

This piece looks a bit strange. Why is the reference count of the port
increased and afterwards decreased again? Still the pointer to the port
gets added to els_fc_job->els.port and therefore the structure will be
accessed later.

So either the reference count is decreased too early and this is a bug
or it's not needed at all.
--
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