]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
OPP: Initialize scope-based pointers inline
authorViresh Kumar <viresh.kumar@linaro.org>
Wed, 22 Oct 2025 07:27:41 +0000 (12:57 +0530)
committerViresh Kumar <viresh.kumar@linaro.org>
Thu, 23 Oct 2025 06:28:05 +0000 (11:58 +0530)
commit173e02d674946ff3ef8da7f44a9d5b820b9af21c
tree9eeacfe682240c7e80f2a2ce8faf8b546a83b4ef
parente6fdbe8feace22ba54ebcf20d6e200fc97c8e065
OPP: Initialize scope-based pointers inline

Uninitialized pointers with `__free` attribute can cause undefined
behaviour as the memory allocated to the pointer is freed automatically
when the pointer goes out of scope.

The OPP core doesn't have any bugs related to this as of now, but it is
better to initialize pointers marked with `__free` attribute at
declaration to simplify the code and ensure proper scope-based cleanup.

Reported-by: Joe Perches <joe@perches.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/opp/core.c
drivers/opp/cpu.c
drivers/opp/of.c