[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DM6PR11MB4657D3968F97531F08BF4F959B702@DM6PR11MB4657.namprd11.prod.outlook.com>
Date: Fri, 19 Jan 2024 13:49:25 +0000
From: "Kubalewski, Arkadiusz" <arkadiusz.kubalewski@...el.com>
To: Jiri Pirko <jiri@...nulli.us>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"vadim.fedorenko@...ux.dev" <vadim.fedorenko@...ux.dev>,
"davem@...emloft.net" <davem@...emloft.net>, "Olech, Milena"
<milena.olech@...el.com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "pabeni@...hat.com" <pabeni@...hat.com>,
"kuba@...nel.org" <kuba@...nel.org>, mschmidt <mschmidt@...hat.com>, "Glaza,
Jan" <jan.glaza@...el.com>, "Kitszel, Przemyslaw"
<przemyslaw.kitszel@...el.com>
Subject: RE: [PATCH net v5 2/4] dpll: fix pin dump crash for rebound module
>From: Jiri Pirko <jiri@...nulli.us>
>Sent: Thursday, January 18, 2024 12:44 PM
>
>Thu, Jan 18, 2024 at 12:07:17PM CET, arkadiusz.kubalewski@...el.com wrote:
>
>[...]
>
>>@@ -443,7 +490,9 @@ dpll_pin_alloc(u64 clock_id, u32 pin_idx, struct
>>module *module,
>> ret = -EINVAL;
>> goto err_pin_prop;
>> }
>>- pin->prop = prop;
>>+ ret = dpll_pin_prop_dup(prop, &pin->prop);
>>+ if (ret)
>>+ goto err_pin_prop;
>> refcount_set(&pin->refcount, 1);
>> xa_init_flags(&pin->dpll_refs, XA_FLAGS_ALLOC);
>> xa_init_flags(&pin->parent_refs, XA_FLAGS_ALLOC);
>
>You are missing dpll_pin_prop_free() call on error path. It should go
>right above "err_pin_prop:" line.
>
>Haste makes waste..
True, fixed in v6.
>
>pw-bot: cr
>
>
>
>>@@ -515,6 +564,7 @@ void dpll_pin_put(struct dpll_pin *pin)
>> xa_destroy(&pin->dpll_refs);
>> xa_destroy(&pin->parent_refs);
>> xa_erase(&dpll_pin_xa, pin->id);
>>+ dpll_pin_prop_free(&pin->prop);
>
>To be symmetric with dpll_pin_alloc() order, xa_erase() should be called
>first here and xa_destroys() in different order. But that is a material
>for net-next.
Makes sense.
Thank you!
Arkadiusz
>
>
>
>> kfree(pin);
>> }
>> mutex_unlock(&dpll_lock);
>
>[...]
Powered by blists - more mailing lists