Re: [PATCH] atm: Fix atm_dev reference count leaks in atmtcp_remove_persistent()

From: Markus Elfring
Date: Wed Jul 29 2020 - 13:17:45 EST


â
> 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