linux/drivers/scsi/device_handler
Bart Van Assche df3d422cba scsi: scsi_dh_alua: Fix a reference counting bug
The code at the end of alua_rtpg_work() is as follows:

	scsi_device_put(sdev);
	kref_put(&pg->kref, release_port_group);

In other words, alua_rtpg_queue() must hold an sdev reference and a pg
reference before queueing rtpg work. If no rtpg work is queued no
additional references should be held when alua_rtpg_queue() returns. If
no rtpg work is queued, ensure that alua_rtpg_queue() only gives up the
sdev reference if that reference was obtained by the same
alua_rtpg_queue() call.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reported-by: Tang Junhui <tang.junhui@zte.com.cn>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Tang Junhui <tang.junhui@zte.com.cn>
Cc: <stable@vger.kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-11-01 13:32:24 -04:00
..
Kconfig scsi_dh: force modular build if SCSI is a module 2016-02-23 21:27:02 -05:00
Makefile scsi_dh: integrate into the core SCSI code 2015-08-28 13:14:56 -07:00
scsi_dh_alua.c scsi: scsi_dh_alua: Fix a reference counting bug 2016-11-01 13:32:24 -04:00
scsi_dh_emc.c scsi_dh_emc: update 'access_state' field 2016-03-05 17:20:33 -05:00
scsi_dh_hp_sw.c scsi_dh: kill struct scsi_dh_data 2015-08-28 13:14:57 -07:00
scsi_dh_rdac.c scsi_dh_rdac: update 'access_state' field 2016-03-05 17:18:28 -05:00