CVE-2022-50340 media: vimc: Fix wrong function called when vimc_init() fails

Medium 5.5 Published Updated

A logic error in the Linux kernel's vimc driver causes a kernel warning and potential instability when initialization fails.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2022-50340?

CVE-2022-50340 is a medium-severity vulnerability in Linux kernel, published on 16 Sep 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

In the Linux kernel, the following vulnerability has been resolved:

media: vimc: Fix wrong function called when vimc_init() fails

In vimc_init(), when platform_driver_register(&vimc_pdrv) fails, platform_driver_unregister(&vimc_pdrv) is wrongly called rather than platform_device_unregister(&vimc_pdev), which causes kernel warning:

Unexpected driver unregister! WARNING: CPU: 1 PID: 14517 at drivers/base/driver.c:270 driver_unregister+0x8f/0xb0 RIP: 0010:driver_unregister+0x8f/0xb0 Call Trace: <TASK> vimc_init+0x7d/0x1000 [vimc] do_one_initcall+0xd0/0x4e0 do_init_module+0x1cf/0x6b0 load_module+0x65c2/0x7820

Weakness: CWE-617

Which versions are affected by CVE-2022-50340?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2022-50340?

Apply the vendor's patch.

Is CVE-2022-50340 being exploited?

There is no known exploitation of CVE-2022-50340 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2022-50340, GHSA-9xrg-r2hf-q6rm, UBUNTU-CVE-2022-50340.

Is CVE-2022-50340 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free