diff options
author | Bart Van Assche <bart.vanassche@sandisk.com> | 2016-11-01 17:19:57 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-11-01 20:32:24 +0300 |
commit | df3d422cbac685da882e4c239dfda07de33d431b (patch) | |
tree | 5d61ed8c7e551eb980a4c1772964bdce25d8c1d8 /drivers/scsi/qla2xxx | |
parent | aac173e9618faadf8f92af6cc05e64f7acc64d79 (diff) | |
download | linux-df3d422cbac685da882e4c239dfda07de33d431b.tar.xz |
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>
Diffstat (limited to 'drivers/scsi/qla2xxx')
0 files changed, 0 insertions, 0 deletions