Re: [PATCH v2] remoteproc: k3-dsp: Fix an error handling path in k3_dsp_rproc_probe()

From: Christophe JAILLET
Date: Tue Sep 10 2024 - 13:05:35 EST


Le 10/09/2024 à 17:29, Mathieu Poirier a écrit :

+static void k3_dsp_free_channel(void *data)
+{
+ struct k3_dsp_rproc *kproc = data;

How did the struct rproc from devm_add_action_or_reset() got turned into a
struct k3_dsp_rproc?


Well, Linux is a wonderful system, that is able to make wonderful thinks!

In this particular case, if it is not the correct explanation, it is likely an unfortunate typo :(
Sorry about that, and thanks for the careful review.
I'll send a v3.


But, looking at it, and trying to see if similar issues may exist, the following naive script spots 2 similar issues. 1 of them looks valid.


I'll try to improve it (Julia in copy, if she wants to give it a look as-well :))

CJ



@devm@
expression RET, DEV;
identifier FCT, VAR;
type T;
@@
T VAR;
...
(
RET = devm_add_action_or_reset(DEV, FCT, VAR);
|
devm_add_action_or_reset(DEV, FCT, VAR);
)

@depends on devm@
identifier FCT = devm.FCT, x, VAR;
type T1 = devm.T, T2;
@@
void FCT(void *x)
{
...
(
T1 VAR = x;
|
* T2 VAR = x;
)
...
}