Previous commit removing a function definition did not remove the
function prototype.
commit 3228900f80c2 ("staging: greybus: Remove unused function
'to_fw_mgmt_connection'")
Function header declaration needs to be removed after definition
removal.
There is no definition of this function nor is there any place where it
is called.
Signed-off-by: Jeremy Dean Clifton <deaner92(a)yahoo.com>
---
v2: Fix grammar and spelling in commit message.
drivers/staging/greybus/firmware.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/staging/greybus/firmware.h b/drivers/staging/greybus/firmware.h
index 5d2564462ffc..04a67d2d5b8f 100644
--- a/drivers/staging/greybus/firmware.h
+++ b/drivers/staging/greybus/firmware.h
@@ -22,7 +22,6 @@
/* Firmware Management Protocol specific functions */
int fw_mgmt_init(void);
void fw_mgmt_exit(void);
-struct gb_connection *to_fw_mgmt_connection(struct device *dev);
int gb_fw_mgmt_request_handler(struct gb_operation *op);
int gb_fw_mgmt_connection_init(struct gb_connection *connection);
void gb_fw_mgmt_connection_exit(struct gb_connection *connection);
--
2.43.0
commit 3228900f80c2
("staging: greybus: Remove unused function 'to_fw_mgmt_connection'")
Function header declaration needs to be removed after it's declaration.
There is no declaration of this function nor is there any place where it
is called.
Signed-off-by: Jeremy Dean Clifton <deaner92(a)yahoo.com>
---
drivers/staging/greybus/firmware.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/staging/greybus/firmware.h b/drivers/staging/greybus/firmware.h
index 5d2564462ffc..04a67d2d5b8f 100644
--- a/drivers/staging/greybus/firmware.h
+++ b/drivers/staging/greybus/firmware.h
@@ -22,7 +22,6 @@
/* Firmware Management Protocol specific functions */
int fw_mgmt_init(void);
void fw_mgmt_exit(void);
-struct gb_connection *to_fw_mgmt_connection(struct device *dev);
int gb_fw_mgmt_request_handler(struct gb_operation *op);
int gb_fw_mgmt_connection_init(struct gb_connection *connection);
void gb_fw_mgmt_connection_exit(struct gb_connection *connection);
--
2.43.0
Similar to this effort:
Subject: [PATCH v1 00/23] PM: runtime: Convert pm_runtime_put() to a void function
https://lore.kernel.org/all/6245770.lOV4Wx5bFT@rafael.j.wysocki/
i.e., commit 3afd8df02433 ("PM: runtime: Change pm_runtime_put() return
type to void") and friends.
As with pm_runtime_put(), there is very little value in return-code
checking for any of the other async __pm_runtime_suspend() and
__pm_runtime_idle() APIs:
pm_runtime_put_autosuspend()
pm_request_idle()
pm_request_autosuspend()
Checking the return code is more likely to
produce a race condition (fighting with user space writing "on" to the
"control" attribute) than to tell a consumer useful info.
Nobody outside KUnit tests checks pm_request_idle() or
pm_request_autosuspend() return codes, but there are a number of
pm_runtime_put_autosuspend() callers that check its return code. Thus,
this series largely deals with pm_runtime_put_autosuspend().
Patches 1-11 are independent of each other, and similarly to the last
series, I expect the respective maintainers can pick them up. We can
apply patch 12 later. Patch 13 is also independent, but included in this
topic for completeness. It can be applied any time.
This touches a lot of trees/maintainers, so I tried to keep CC's only
for the relevant patch(es), plus the cover letter. I hope that's not too
noisy.
- Brian
Brian Norris (13):
hwrng: cctrng: Discard pm_runtime_put_autosuspend() return value
drm: Discard pm_runtime_put_autosuspend() return values
iio: Discard pm_runtime_put_autosuspend() return values
media: venus: Discard pm_runtime_put_autosuspend() return values
pinctrl: qcom: lpass-lpi: Discard pm_runtime_put_autosuspend() return
values
spi: ti-qspi: Discard pm_runtime_put_autosuspend() return value
greybus: Discard pm_runtime_put_autosuspend() return value
ALSA: hda: Discard pm_runtime_put_autosuspend() return value
ASoC: codecs: lpass: Discard pm_runtime_put_autosuspend() return
values
ASoC: intel: atom: Discard pm_runtime_put_autosuspend() return value
ASoC: SOF: Discard pm_runtime_put_autosuspend() return values
PM: runtime: Drop pm_runtime_put_autosuspend() return code
PM: runtime: Drop pm_request_{idle,autosuspend}() return codes
drivers/base/power/runtime-test.c | 8 ---
drivers/char/hw_random/cctrng.c | 6 +-
drivers/gpu/drm/panel/panel-simple.c | 8 +--
drivers/gpu/drm/tidss/tidss_drv.c | 7 +--
drivers/gpu/drm/v3d/v3d_drv.h | 4 +-
drivers/iio/accel/bmc150-accel-core.c | 14 ++---
drivers/iio/accel/fxls8962af-core.c | 11 +---
drivers/iio/accel/kxcjk-1013.c | 15 ++---
drivers/iio/accel/mma8452.c | 15 +++--
drivers/iio/accel/mma9551_core.c | 15 +++--
drivers/iio/adc/rcar-gyroadc.c | 4 +-
drivers/iio/adc/ti-ads1015.c | 8 +--
drivers/iio/chemical/atlas-sensor.c | 4 +-
.../common/hid-sensors/hid-sensor-trigger.c | 14 ++---
drivers/iio/gyro/bmg160_core.c | 17 +++--
drivers/iio/gyro/fxas21002c_core.c | 12 ++--
drivers/iio/imu/kmx61.c | 17 +++--
drivers/iio/light/apds9960.c | 2 +-
drivers/iio/light/isl29028.c | 15 +----
drivers/iio/light/pa12203001.c | 3 +-
drivers/iio/light/rpr0521.c | 15 +++--
drivers/iio/light/tsl2583.c | 27 ++------
drivers/iio/light/us5182d.c | 3 +-
drivers/media/platform/qcom/venus/vdec.c | 10 ++-
drivers/media/platform/qcom/venus/venc.c | 10 ++-
drivers/pinctrl/qcom/pinctrl-lpass-lpi.c | 16 +++--
drivers/spi/spi-ti-qspi.c | 6 +-
drivers/staging/greybus/power_supply.c | 8 +--
include/linux/greybus/bundle.h | 12 +---
include/linux/pm_runtime.h | 63 +++----------------
include/sound/hdaudio.h | 8 +--
sound/hda/core/device.c | 13 ++--
sound/soc/codecs/lpass-rx-macro.c | 4 +-
sound/soc/codecs/lpass-tx-macro.c | 4 +-
sound/soc/codecs/lpass-va-macro.c | 17 ++---
sound/soc/codecs/lpass-wsa-macro.c | 8 +--
sound/soc/intel/atom/sst/sst.h | 2 +-
sound/soc/intel/atom/sst/sst_drv_interface.c | 4 +-
sound/soc/intel/atom/sst/sst_pvt.c | 9 +--
sound/soc/sof/control.c | 6 +-
sound/soc/sof/sof-client-ipc-flood-test.c | 5 +-
.../soc/sof/sof-client-ipc-kernel-injector.c | 4 +-
sound/soc/sof/sof-client-ipc-msg-injector.c | 6 +-
sound/soc/sof/sof-client-probes.c | 18 ++----
44 files changed, 152 insertions(+), 325 deletions(-)
--
2.56.0.360.g66cac248cb-goog
Automated semantic analysis via Coccinelle uncovered a use-after-free
vulnerability in gbcodec_hw_params() caused by accessing a list
iterator variable outside the loop boundary.
The routine walks through the codec module list using
'list_for_each_entry' to locate a matching data connection.
After the loop exits, the iterator pointer 'module' becomes
out-of-bounds. Attempting to pass this unmapped reference into
'to_gb_bundle()' down the line triggers a critical kernel panic.
Fix this flaw by introducing a dedicated copy 'allocated_module'.
Cache the matched pointer inside the loop block only when
'find_data()' returns a valid reference, and route the subsequent
power management execution steps safely through this verified object
tracking reference.
Assisted-by: Gemini
Signed-off-by: Marinela Tatiana Selseth <marinela.selseth(a)firmwaredesign.org>
---
drivers/staging/greybus/audio_codec.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
index 6daa4e706792..a0645bf83097 100644
--- a/drivers/staging/greybus/audio_codec.c
+++ b/drivers/staging/greybus/audio_codec.c
@@ -396,6 +396,7 @@ static int gbcodec_hw_params(struct snd_pcm_substream *substream,
u8 sig_bits, channels;
u32 format, rate;
struct gbaudio_module_info *module;
+ struct gbaudio_module_info *allocated_module = NULL;
struct gbaudio_data_connection *data;
struct gb_bundle *bundle;
struct gbaudio_codec_info *codec = dev_get_drvdata(dai->dev);
@@ -439,8 +440,10 @@ static int gbcodec_hw_params(struct snd_pcm_substream *substream,
/* find the data connection */
list_for_each_entry(module, &codec->module_list, list) {
data = find_data(module, dai->id);
- if (data)
+ if (data) {
+ allocated_module = module;
break;
+ }
}
if (!data) {
@@ -456,7 +459,7 @@ static int gbcodec_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
}
- bundle = to_gb_bundle(module->dev);
+ bundle = to_gb_bundle(allocated_module->dev);
ret = gb_pm_runtime_get_sync(bundle);
if (ret) {
mutex_unlock(&codec->lock);
--
2.43.0