All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: zfcp: remove redundant put_device
@ 2018-09-06  6:16 Ding Xiang
  2018-09-06  6:24 ` Heiko Carstens
  0 siblings, 1 reply; 3+ messages in thread
From: Ding Xiang @ 2018-09-06  6:16 UTC (permalink / raw)
  To: schwidefsky, heiko.carstens, linux-s390, linux-kernel

device_unregister will put device, do not need to do it one more time

Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>
---
 drivers/s390/scsi/zfcp_unit.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/s390/scsi/zfcp_unit.c b/drivers/s390/scsi/zfcp_unit.c
index 1bf0a09..6b50084 100644
--- a/drivers/s390/scsi/zfcp_unit.c
+++ b/drivers/s390/scsi/zfcp_unit.c
@@ -249,8 +249,6 @@ int zfcp_unit_remove(struct zfcp_port *port, u64 fcp_lun)
 		scsi_device_put(sdev);
 	}
 
-	put_device(&unit->dev);
-
 	device_unregister(&unit->dev);
 
 	return 0;
-- 
1.9.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: zfcp: remove redundant put_device
  2018-09-06  6:16 [PATCH] scsi: zfcp: remove redundant put_device Ding Xiang
@ 2018-09-06  6:24 ` Heiko Carstens
  2018-09-06  6:43   ` Ding Xiang
  0 siblings, 1 reply; 3+ messages in thread
From: Heiko Carstens @ 2018-09-06  6:24 UTC (permalink / raw)
  To: Ding Xiang
  Cc: schwidefsky, linux-s390, linux-kernel, Steffen Maier, Benjamin Block

On Thu, Sep 06, 2018 at 02:16:27PM +0800, Ding Xiang wrote:
> device_unregister will put device, do not need to do it one more time
> 
> Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>
> ---
>  drivers/s390/scsi/zfcp_unit.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/s390/scsi/zfcp_unit.c b/drivers/s390/scsi/zfcp_unit.c
> index 1bf0a09..6b50084 100644
> --- a/drivers/s390/scsi/zfcp_unit.c
> +++ b/drivers/s390/scsi/zfcp_unit.c
> @@ -249,8 +249,6 @@ int zfcp_unit_remove(struct zfcp_port *port, u64 fcp_lun)
>  		scsi_device_put(sdev);
>  	}
> 
> -	put_device(&unit->dev);
> -
>  	device_unregister(&unit->dev);
> 
>  	return 0;

I'm quite sure this change is wrong, since the put_device() here seems to
pair with the get_device() in _zfcp_unit_find(). So we would end up with a
memory leak.

Adding Steffen and Benjamin.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: zfcp: remove redundant put_device
  2018-09-06  6:24 ` Heiko Carstens
@ 2018-09-06  6:43   ` Ding Xiang
  0 siblings, 0 replies; 3+ messages in thread
From: Ding Xiang @ 2018-09-06  6:43 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: schwidefsky, linux-s390, linux-kernel, Steffen Maier, Benjamin Block


On 9/6/2018 2:24 PM, Heiko Carstens wrote:
> On Thu, Sep 06, 2018 at 02:16:27PM +0800, Ding Xiang wrote:
>> device_unregister will put device, do not need to do it one more time
>>
>> Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>
>> ---
>>   drivers/s390/scsi/zfcp_unit.c | 2 --
>>   1 file changed, 2 deletions(-)
>>
>> diff --git a/drivers/s390/scsi/zfcp_unit.c b/drivers/s390/scsi/zfcp_unit.c
>> index 1bf0a09..6b50084 100644
>> --- a/drivers/s390/scsi/zfcp_unit.c
>> +++ b/drivers/s390/scsi/zfcp_unit.c
>> @@ -249,8 +249,6 @@ int zfcp_unit_remove(struct zfcp_port *port, u64 fcp_lun)
>>   		scsi_device_put(sdev);
>>   	}
>>
>> -	put_device(&unit->dev);
>> -
>>   	device_unregister(&unit->dev);
>>
>>   	return 0;
> I'm quite sure this change is wrong, since the put_device() here seems to
> pair with the get_device() in _zfcp_unit_find(). So we would end up with a
> memory leak.

Indeed,please ignore this patch.


> Adding Steffen and Benjamin.
>
>
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-06  6:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06  6:16 [PATCH] scsi: zfcp: remove redundant put_device Ding Xiang
2018-09-06  6:24 ` Heiko Carstens
2018-09-06  6:43   ` Ding Xiang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.