Commit a9711f6
media: i2c: et8ek8: Don't strip remove function when driver is builtin
Using __exit for the remove function results in the remove callback
being discarded with CONFIG_VIDEO_ET8EK8=y. When such a device gets
unbound (e.g. using sysfs or hotplug), the driver is just removed
without the cleanup being performed. This results in resource leaks. Fix
it by compiling in the remove callback unconditionally.
This also fixes a W=1 modpost warning:
WARNING: modpost: drivers/media/i2c/et8ek8/et8ek8: section mismatch in reference: et8ek8_i2c_driver+0x10 (section: .data) -> et8ek8_remove (section: .exit.text)
Fixes: c5254e7 ("[media] media: Driver for Toshiba et8ek8 5MP sensor")
Signed-off-by: Uwe Kleine-König <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
CVE-2024-38611
(backported from commit 545b215)
[hui: This backport adjusts context due to 2 conflict, the 1st one is
the return type of et8ek8_remove(), in J and F, the return type is int
while in original commit the return type is void, here I kept the
return type to int; the other one is probe function type, in the J and
F, it is probe_new, in the original commit, it is probe, here I kept
probe_new since it is unrelevant to this CVE case.]
Signed-off-by: Hui Wang <[email protected]>
Acked-by: Koichiro Den <[email protected]>
Acked-by: Mehmet Basaran <[email protected]>
Signed-off-by: Stefan Bader <[email protected]>1 parent 1caf1dd commit a9711f6
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1460 | 1460 | | |
1461 | 1461 | | |
1462 | 1462 | | |
1463 | | - | |
| 1463 | + | |
1464 | 1464 | | |
1465 | 1465 | | |
1466 | 1466 | | |
| |||
1504 | 1504 | | |
1505 | 1505 | | |
1506 | 1506 | | |
1507 | | - | |
| 1507 | + | |
1508 | 1508 | | |
1509 | 1509 | | |
1510 | 1510 | | |
| |||
0 commit comments