Re: [PATCH] scsi_dh_alua: fix missing kref_put() in alua_rtpg_work()

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

 



On 10/28/2016 09:54 AM, tang.junhui@xxxxxxxxxx wrote:
> From: "tang.junhui" <tang.junhui@xxxxxxxxxx>
> 
> Reference count of pg leaks in alua_rtpg_work() since kref_put()
> is not called to decrease the reference count of pg when the
> condition pg->rtpg_sdev==NULL satisfied (actually it is easy to
> satisfy), it would cause memory of pg leakage.
> 
> Signed-off-by: tang.junhui <tang.junhui@xxxxxxxxxx>
> ---
>  drivers/scsi/device_handler/scsi_dh_alua.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
> index 241829e..f375167 100644
> --- a/drivers/scsi/device_handler/scsi_dh_alua.c
> +++ b/drivers/scsi/device_handler/scsi_dh_alua.c
> @@ -793,6 +793,7 @@ static void alua_rtpg_work(struct work_struct *work)
>  		WARN_ON(pg->flags & ALUA_PG_RUN_RTPG);
>  		WARN_ON(pg->flags & ALUA_PG_RUN_STPG);
>  		spin_unlock_irqrestore(&pg->lock, flags);
> +		kref_put(&pg->kref, release_port_group);
>  		return;
>  	}
>  	if (pg->flags & ALUA_SYNC_STPG)
> 
Correct.

Reviewed-by: Hannes Reinecke <hare@xxxxxxxx>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@xxxxxxx			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
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