All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] atm: Fix atm_dev reference count leaks in atmtcp_remove_persistent()
@ 2020-07-29 17:16 ` Markus Elfring
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2020-07-29 17:16 UTC (permalink / raw)
  To: Xin Xiong, Xiyu Yang, Xin Tan, linux-atm-general, netdev
  Cc: linux-kernel, kernel-janitors, Chas Williams, Yuan Zhang

…
> The refcount leaks issues occur in two error handling paths.

Can it be nicer to use the term “reference count” for the commit message?


> Fix the issue by …

I suggest to replace this wording by the tag “Fixes”.


…
> +++ b/drivers/atm/atmtcp.c
> @@ -433,9 +433,15 @@  static int atmtcp_remove_persistent(int itf)
>  		return -EMEDIUMTYPE;
>  	}
>  	dev_data = PRIV(dev);
> -	if (!dev_data->persist) return 0;
> +	if (!dev_data->persist) {
> +		atm_dev_put(dev);
> +		return 0;
> +	}
…

I propose to add a jump target for the desired exception handling
in this function implementation.

+	if (!dev_data->persist)
+		goto put_device;


Regards,
Markus

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

* Re: [PATCH] atm: Fix atm_dev reference count leaks in atmtcp_remove_persistent()
@ 2020-07-29 17:16 ` Markus Elfring
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2020-07-29 17:16 UTC (permalink / raw)
  To: Xin Xiong, Xiyu Yang, Xin Tan, linux-atm-general, netdev
  Cc: linux-kernel, kernel-janitors, Chas Williams, Yuan Zhang

…
> The refcount leaks issues occur in two error handling paths.

Can it be nicer to use the term “reference count” for the commit message?


> Fix the issue by …

I suggest to replace this wording by the tag “Fixes”.


…
> +++ b/drivers/atm/atmtcp.c
> @@ -433,9 +433,15 @@  static int atmtcp_remove_persistent(int itf)
>  		return -EMEDIUMTYPE;
>  	}
>  	dev_data = PRIV(dev);
> -	if (!dev_data->persist) return 0;
> +	if (!dev_data->persist) {
> +		atm_dev_put(dev);
> +		return 0;
> +	}
…

I propose to add a jump target for the desired exception handling
in this function implementation.

+	if (!dev_data->persist)
+		goto put_device;


Regards,
Markus

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

end of thread, other threads:[~2020-07-29 17:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-29 17:16 [PATCH] atm: Fix atm_dev reference count leaks in atmtcp_remove_persistent() Markus Elfring
2020-07-29 17:16 ` Markus Elfring

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.