WSL2-Linux-Kernel/drivers/gpu/drm
Yuan Can bc79cb9fb0 drm/vc4: Fix missing platform_unregister_drivers() call in vc4_drm_register()
[ Upstream commit cf53db768a ]

A problem about modprobe vc4 failed is triggered with the following log
given:

 [  420.327987] Error: Driver 'vc4_hvs' is already registered, aborting...
 [  420.333904] failed to register platform driver vc4_hvs_driver [vc4]: -16
 modprobe: ERROR: could not insert 'vc4': Device or resource busy

The reason is that vc4_drm_register() returns platform_driver_register()
directly without checking its return value, if platform_driver_register()
fails, it returns without unregistering all the vc4 drivers, resulting the
vc4 can never be installed later.
A simple call graph is shown as below:

 vc4_drm_register()
   platform_register_drivers() # all vc4 drivers are registered
   platform_driver_register()
     driver_register()
       bus_add_driver()
         priv = kzalloc(...) # OOM happened
   # return without unregister drivers

Fixing this problem by checking the return value of
platform_driver_register() and do platform_unregister_drivers() if
error happened.

Fixes: c8b75bca92 ("drm/vc4: Add KMS support for Raspberry Pi.")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20221103014705.109322-1-yuancan@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-11-16 09:58:18 +01:00
..
amd drm/amdkfd: Fix NULL pointer dereference in svm_migrate_to_ram() 2022-11-16 09:58:13 +01:00
arm drm/komeda: Fix handling of atomic commits in the atomic_commit_tail hook 2022-10-26 12:35:38 +02:00
armada gup: Turn fault_in_pages_{readable,writeable} into fault_in_{readable,writeable} 2022-05-01 17:22:28 +02:00
aspeed drm/aspeed: Fix vga_pw sysfs output 2021-12-01 09:04:47 +01:00
ast drm/ast: Create threshold values for AST2600 2022-06-14 18:36:27 +02:00
atmel-hlcdc
bridge drm: bridge: dw_hdmi: only trigger hotplug event on link change 2022-10-26 12:35:39 +02:00
etnaviv drm/etnaviv: check for reaped mapping in etnaviv_iommu_unmap_gem 2022-06-09 10:23:24 +02:00
exynos drm/exynos/exynos7_drm_decon: free resources when clk_set_parent() failed. 2022-08-17 14:23:30 +02:00
fsl-dcu
gma500 drm/gma500: Fix BUG: sleeping function called from invalid context errors 2022-09-28 11:11:55 +02:00
gud
hisilicon drm/hisilicon: Add depends on MMU 2022-09-28 11:11:50 +02:00
hyperv drm/hyperv-drm: Include framebuffer and EDID headers 2022-08-17 14:22:53 +02:00
i2c
i810
i915 drm/i915/sdvo: Setup DDC fully before output init 2022-11-10 18:15:43 +01:00
imx drm/imx/dcss: get rid of HPD warning message 2022-08-25 11:40:28 +02:00
ingenic
kmb drm/kmb: Fix for build errors with Warray-bounds 2022-02-08 18:34:09 +01:00
lib
lima drm/shmem-helper: Pass GEM shmem object in public interfaces 2022-08-17 14:23:19 +02:00
mcde drm/mcde: Fix refcount leak in mcde_dsi_bind 2022-08-17 14:23:23 +02:00
mediatek drm/mediatek: dsi: Move mtk_dsi_stop() call back to mtk_dsi_poweroff() 2022-09-28 11:11:53 +02:00
meson drm/meson: explicitly remove aggregate driver at module unload time 2022-10-26 12:35:41 +02:00
mga
mgag200 mgag200 fix memmapsl configuration in GCTL6 register 2022-04-08 14:23:00 +02:00
msm drm/msm/hdmi: fix IRQ lifetime 2022-11-10 18:15:32 +01:00
mxsfb drm: mxsfb: Fix NULL pointer dereference 2022-03-08 19:12:40 +01:00
nouveau drm/nouveau/nouveau_bo: fix potential memory leak in nouveau_bo_alloc() 2022-10-26 12:35:38 +02:00
omapdrm drm/omap: dss: Fix refcount leak bugs 2022-10-26 12:34:54 +02:00
panel drm/panel: simple: Fix innolux_g121i1_l01 bus_format 2022-09-28 11:11:48 +02:00
panfrost drm/panfrost: devfreq: set opp to the recommended one to configure regulator 2022-09-23 14:15:51 +02:00
pl111 drm:pl111: Add of_node_put() when breaking out of for_each_available_child_of_node() 2022-10-26 12:34:51 +02:00
qxl
r128 drm/r128: fix build for UML 2021-10-15 15:05:10 +10:00
radeon drm/radeon: add a force flush to delay work when radeon 2022-09-15 11:30:01 +02:00
rcar-du drm: rcar-du: Fix CRTC timings when CMM is used 2022-01-27 11:04:35 +01:00
rockchip drm/rockchip: dsi: Force synchronous probe 2022-11-10 18:15:43 +01:00
savage
scheduler
selftests drm/selftests/test-drm_dp_mst_helper: Fix memory leak in sideband_msg_req_encode_decode 2022-04-08 14:23:24 +02:00
shmobile
sis
sti
stm stm: ltdc: fix two incorrect NULL checks on list iterator 2022-06-09 10:23:28 +02:00
sun4i drm/sun4i: dsi: Prevent underflow when computing packet sizes 2022-08-25 11:40:29 +02:00
tdfx
tegra drm/tegra: vic: Fix build warning when CONFIG_PM=n 2022-09-23 14:15:46 +02:00
tidss
tilcdc tilcdc: tilcdc_external: fix an incorrect NULL check on list iterator 2022-06-09 10:23:29 +02:00
tiny drm/bochs: fix blanking 2022-10-26 12:34:54 +02:00
ttm drm/ttm: Fix dummy res NULL ptr deref bug 2022-08-25 11:39:54 +02:00
tve200
udl drm/udl: Restore display mode on resume 2022-10-26 12:34:24 +02:00
v3d drm/shmem-helper: Pass GEM shmem object in public interfaces 2022-08-17 14:23:19 +02:00
vboxvideo drm/vboxvideo: fix a NULL vs IS_ERR() check 2022-01-27 11:03:13 +01:00
vc4 drm/vc4: Fix missing platform_unregister_drivers() call in vc4_drm_register() 2022-11-16 09:58:18 +01:00
vgem
via
virtio drm/virtio: Correct drm_gem_shmem_get_sg_table() error handling 2022-10-26 12:34:51 +02:00
vkms
vmwgfx drm/vmwgfx: Fix memory leak in vmw_mksstat_add_ioctl() 2022-10-26 12:34:55 +02:00
xen
xlnx
zte
Kconfig Revert "drm: fb_helper: fix CONFIG_FB dependency" 2021-11-21 13:44:12 +01:00
Makefile
drm_agpsupport.c
drm_aperture.c drm/aperture: Run fbdev removal before internal helpers 2022-07-21 21:24:44 +02:00
drm_atomic.c drm/atomic: Add the crtc to affected crtc only if uapi.enable = true 2022-02-01 17:27:01 +01:00
drm_atomic_helper.c drm/atomic: Force bridge self-refresh-exit on CRTC switch 2022-06-14 18:36:27 +02:00
drm_atomic_state_helper.c
drm_atomic_uapi.c drm/atomic: Don't pollute crtc_state->mode_blob with error pointers 2022-02-23 12:03:08 +01:00
drm_auth.c
drm_blend.c
drm_bridge.c drm/bridge: Avoid uninitialized variable warning 2022-10-26 12:34:50 +02:00
drm_bridge_connector.c drm/bridge_connector: enable HPD by default if supported 2022-06-09 10:22:44 +02:00
drm_bufs.c
drm_cache.c
drm_client.c
drm_client_modeset.c
drm_color_mgmt.c
drm_connector.c drm/vrr: Set VRR capable prop only if it is attached to connector 2022-03-19 13:47:49 +01:00
drm_context.c
drm_crtc.c
drm_crtc_helper.c
drm_crtc_helper_internal.h
drm_crtc_internal.h
drm_damage_helper.c
drm_debugfs.c
drm_debugfs_crc.c
drm_displayid.c
drm_dma.c
drm_dp_aux_bus.c drm/dp: Export symbol / kerneldoc fixes for DP AUX bus 2022-08-17 14:23:16 +02:00
drm_dp_aux_dev.c
drm_dp_cec.c
drm_dp_dual_mode_helper.c
drm_dp_helper.c drm/dp: Don't rewrite link config when setting phy test pattern 2022-10-26 12:35:42 +02:00
drm_dp_mst_topology.c drm/dp_mst: fix drm_dp_dpcd_read return value checks 2022-10-26 12:34:51 +02:00
drm_dp_mst_topology_internal.h
drm_drv.c drm: fix null-ptr-deref in drm_dev_init_release() 2022-01-27 11:03:01 +01:00
drm_dsc.c
drm_dumb_buffers.c
drm_edid.c drm/edid: fix invalid EDID extension block filtering 2022-06-09 10:22:44 +02:00
drm_edid_load.c
drm_encoder.c
drm_encoder_slave.c
drm_fb_cma_helper.c
drm_fb_helper.c drm/fb-helper: Mark screen buffers in system memory with FBINFO_VIRTFB 2022-04-08 14:23:03 +02:00
drm_file.c
drm_flip_work.c
drm_format_helper.c
drm_fourcc.c
drm_framebuffer.c
drm_gem.c drm/gem: Fix GEM handle release errors 2022-09-15 11:30:01 +02:00
drm_gem_atomic_helper.c
drm_gem_cma_helper.c drm/cma-helper: Set VM_DONTEXPAND for mmap 2022-02-23 12:03:09 +01:00
drm_gem_framebuffer_helper.c
drm_gem_shmem_helper.c drm/shmem-helper: Pass GEM shmem object in public interfaces 2022-08-17 14:23:19 +02:00
drm_gem_ttm_helper.c drm/ttm: fix locking in vmap/vunmap TTM GEM helpers 2022-07-29 17:25:05 +02:00
drm_gem_vram_helper.c
drm_hashtab.c
drm_hdcp.c
drm_internal.h drm/gem: Fix GEM handle release errors 2022-09-15 11:30:01 +02:00
drm_ioc32.c
drm_ioctl.c drm: Prevent drm_copy_field() to attempt copying a NULL pointer 2022-10-26 12:35:38 +02:00
drm_irq.c
drm_kms_helper_common.c
drm_lease.c
drm_legacy.h
drm_legacy_misc.c
drm_lock.c
drm_managed.c
drm_memory.c
drm_mipi_dbi.c drm/mipi-dbi: align max_chunk to 2 in spi_transfer 2022-08-17 14:23:17 +02:00
drm_mipi_dsi.c drm/mipi-dsi: Detach devices when removing the host 2022-10-26 12:34:50 +02:00
drm_mm.c
drm_mode_config.c
drm_mode_object.c
drm_modes.c
drm_modeset_helper.c
drm_modeset_lock.c
drm_of.c drm/bridge: Add a function to abstract away panels 2022-08-17 14:23:24 +02:00
drm_panel.c
drm_panel_orientation_quirks.c drm: panel-orientation-quirks: Add quirk for Anbernic Win600 2022-10-26 12:35:40 +02:00
drm_pci.c
drm_plane.c drm/plane: Move range check for format_count earlier 2022-06-09 10:22:34 +02:00
drm_plane_helper.c drm/plane-helper: fix uninitialized variable reference 2021-11-18 19:17:00 +01:00
drm_prime.c drm/gem: Fix GEM handle release errors 2022-09-15 11:30:01 +02:00
drm_print.c
drm_probe_helper.c
drm_property.c
drm_rect.c
drm_scatter.c
drm_scdc_helper.c
drm_self_refresh_helper.c
drm_simple_kms_helper.c
drm_syncobj.c drm/syncobj: flatten dma_fence_chains on transfer 2022-04-08 14:23:03 +02:00
drm_sysfs.c
drm_trace.h
drm_trace_points.c
drm_vblank.c
drm_vblank_work.c
drm_vm.c
drm_vma_manager.c
drm_writeback.c