kernel_optimize_test/drivers/gpu/drm
Christophe JAILLET 9e40f2c513 drm/nouveau: Fix a potential theorical leak in nouveau_get_backlight_name()
[ Upstream commit ab244be47a8f111bc82496a8a20c907236e37f95 ]

If successful ida_simple_get() calls are not undone when needed, some
additional memory may be allocated and wasted.

Here, an ID between 0 and MAX_INT is required. If this ID is >=100, it is
not taken into account and is wasted. It should be released.

Instead of calling ida_simple_remove(), take advantage of the 'max'
parameter to require the ID not to be too big. Should it be too big, it
is not allocated and don't need to be freed.

While at it, use ida_alloc_xxx()/ida_free() instead to
ida_simple_get()/ida_simple_remove().
The latter is deprecated and more verbose.

Fixes: db1a0ae214 ("drm/nouveau/bl: Assign different names to interfaces")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Lyude Paul <lyude@redhat.com>
[Fixed formatting warning from checkpatch]
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/9ba85bca59df6813dc029e743a836451d5173221.1644386541.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-05-18 10:23:43 +02:00
..
amd drm/amd/display/dc/gpio/gpio_service: Pass around correct dce_{version, environment} types 2022-05-15 20:00:09 +02:00
arc
arm drm/arm/malidp: Always list modifiers 2021-07-19 09:44:58 +02:00
armada
aspeed drm/aspeed: Fix Kconfig warning & subsequent build errors 2020-12-30 11:52:56 +01:00
ast drm/ast: potential dereference of null pointer 2021-12-22 09:30:54 +01:00
atmel-hlcdc
bochs
bridge drm/bridge: cdns-dsi: Make sure to to create proper aliases for dt 2022-04-08 14:40:18 +02:00
etnaviv drm/etnaviv: relax submit size limits 2022-02-01 17:25:40 +01:00
exynos drm/exynos: Always initialize mapping in exynos_drm_register_dma() 2021-09-18 13:40:30 +02:00
fsl-dcu
gma500 drm/gma500: Fix end of loop tests for list_for_each_entry 2021-09-15 09:50:31 +02:00
hisilicon drm/hisilicon: Fix use-after-free 2021-03-07 12:34:11 +01:00
i2c
i810
i915 drm/i915: Fix SEL_FETCH_PLANE_*(PIPE_B+) register addresses 2022-05-09 09:05:07 +02:00
imx drm/imx: Fix memory leak in imx_pd_connector_get_modes 2022-04-13 21:01:04 +02:00
ingenic drm/ingenic: Switch IPU plane to type OVERLAY 2021-07-20 16:05:37 +02:00
lib
lima drm/lima: fix warning when CONFIG_DEBUG_SG=y & CONFIG_DMA_API_DEBUG=y 2022-01-27 10:54:10 +01:00
mcde drm/mcde: Fix off by 10^3 in calculation 2021-06-16 12:01:44 +02:00
mediatek phy: mediatek: Fix missing check in mtk_mipi_tx_probe 2022-01-27 10:54:24 +01:00
meson drm/meson: osd_afbcd: Add an exit callback to struct meson_afbcd_ops 2022-04-08 14:40:11 +02:00
mga
mgag200 mgag200 fix memmapsl configuration in GCTL6 register 2022-04-08 14:39:56 +02:00
msm drm/msm/mdp5: check the return of kzalloc() 2022-04-27 13:53:53 +02:00
mxsfb drm: mxsfb: Fix NULL pointer dereference crash on unload 2021-10-27 09:56:54 +02:00
nouveau drm/nouveau: Fix a potential theorical leak in nouveau_get_backlight_name() 2022-05-18 10:23:43 +02:00
omapdrm drm/omap: dmm_tiler: fix return error code in omap_dmm_probe() 2020-12-30 11:53:13 +01:00
panel drm/panel/raspberrypi-touchscreen: Initialise the bridge in prepare 2022-04-27 13:53:56 +02:00
panfrost drm/panfrost: Check for error num after setting mask 2022-04-08 14:40:12 +02:00
pl111 amba: Make the remove callback return void 2022-04-08 14:40:02 +02:00
qxl drm: qxl: ensure surf.data is ininitialized 2021-07-14 16:56:20 +02:00
r128
radeon drm/radeon: Fix backlight control on iMac 12,1 2022-02-23 12:01:01 +01:00
rcar-du drm: rcar-du: Fix CRTC timings when CMM is used 2022-01-27 10:54:14 +01:00
rockchip drm/rockchip: dw_hdmi: Do not leave clock enabled in error case 2022-02-23 12:01:06 +01:00
savage
scheduler drm/sched: Avoid data corruptions 2021-07-19 09:44:40 +02:00
selftests
shmobile
sis
sti
stm drm/stm: Fix bus_flags handling 2021-05-14 09:50:22 +02:00
sun4i drm/sun4i: mixer: Fix P010 and P210 format numbers 2022-03-16 14:15:57 +01:00
tdfx
tegra drm/tegra: Fix reference leak in tegra_dsi_ganged_probe 2022-04-08 14:40:18 +02:00
tidss
tilcdc drm/tilcdc: send vblank event when disabling crtc 2021-05-14 09:50:21 +02:00
tiny drm: Use USB controller's DMA mask when importing dmabufs 2021-03-17 17:06:19 +01:00
ttm drm/ttm: Put BO in its memory manager's lru list 2022-01-27 10:53:44 +01:00
tve200 drm/tve200: Fix handling of platform_get_irq() error 2020-12-30 11:52:56 +01:00
udl drm/udl: fix control-message timeout 2021-11-26 10:39:20 +01:00
v3d drm/v3d: fix wait for TMU write combiner flush 2021-11-18 14:04:02 +01:00
vboxvideo drm/vboxvideo: fix a NULL vs IS_ERR() check 2022-01-27 10:53:49 +01:00
vc4 drm/vc4: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage 2022-04-27 13:53:56 +02:00
vgem
via
virtio virtio-gpu: fix possible memory allocation failure 2021-11-18 14:04:02 +01:00
vkms drm/vkms: fix misuse of WARN_ON 2021-05-11 14:47:26 +02:00
vmwgfx drm/vmwgfx: Fix stale file descriptors on failed usercopy 2022-01-29 10:26:11 +01:00
xen gpu/xen: Fix a use after free in xen_drm_drv_init 2021-04-21 13:00:52 +02:00
xlnx drm: xlnx: zynqmp: release reset to DP controller before accessing DP registers 2021-09-18 13:40:27 +02:00
zte drm/zte: Don't select DRM_KMS_FB_HELPER 2021-07-19 09:44:36 +02:00
drm_agpsupport.c
drm_atomic_helper.c drm/atomic: put state on error path 2021-01-27 11:54:55 +01:00
drm_atomic_state_helper.c
drm_atomic_uapi.c
drm_atomic.c
drm_auth.c drm: protect drm_master pointers in drm_lease.c 2021-09-18 13:40:19 +02:00
drm_blend.c
drm_bridge_connector.c
drm_bridge.c drm/bridge: Fix the stop condition of drm_bridge_chain_pre_enable() 2021-07-14 16:56:15 +02:00
drm_bufs.c
drm_cache.c
drm_client_modeset.c
drm_client.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:44:45 +01:00
drm_context.c
drm_crtc_helper_internal.h
drm_crtc_helper.c
drm_crtc_internal.h
drm_crtc.c
drm_damage_helper.c
drm_debugfs_crc.c
drm_debugfs.c drm: avoid blocking in drm_clients_info's rcu section 2021-09-18 13:40:19 +02:00
drm_dma.c
drm_dp_aux_dev.c drm/dp_aux_dev: check aux_dev before use in drm_dp_aux_dev_get_by_minor() 2020-12-30 11:54:19 +01:00
drm_dp_cec.c
drm_dp_dual_mode_helper.c
drm_dp_helper.c drm/dp: Handle zeroed port counts in drm_dp_read_downstream_info() 2021-07-19 09:44:57 +02:00
drm_dp_mst_topology_internal.h
drm_dp_mst_topology.c drm/dp_mst: Fix return code on sideband message failure 2021-09-18 13:40:37 +02:00
drm_drv.c drm: fix null-ptr-deref in drm_dev_init_release() 2022-01-27 10:53:44 +01:00
drm_dsc.c
drm_dumb_buffers.c
drm_edid_load.c
drm_edid.c drm/edid: Don't clear formats if using deep color 2022-04-08 14:40:13 +02:00
drm_encoder_slave.c
drm_encoder.c
drm_fb_cma_helper.c
drm_fb_helper.c drm/fb-helper: Add missed unlocks in setcmap_legacy() 2021-03-04 11:37:36 +01:00
drm_file.c drm: serialize drm_file.master with a new spinlock 2021-09-18 13:40:19 +02:00
drm_flip_work.c
drm_format_helper.c
drm_fourcc.c
drm_framebuffer.c
drm_gem_cma_helper.c
drm_gem_framebuffer_helper.c
drm_gem_shmem_helper.c drm/shmem-helpers: vunmap: Don't put pages for dma-buf 2021-03-17 17:06:19 +01:00
drm_gem_ttm_helper.c
drm_gem_vram_helper.c
drm_gem.c
drm_hashtab.c
drm_hdcp.c
drm_internal.h
drm_ioc32.c drm: Copy drm_wait_vblank to user before returning 2021-09-03 10:09:27 +02:00
drm_ioctl.c drm: Return -ENOTTY for non-drm ioctls 2021-07-28 14:35:47 +02:00
drm_irq.c
drm_kms_helper_common.c
drm_lease.c drm: protect drm_master pointers in drm_lease.c 2021-09-18 13:40:19 +02:00
drm_legacy_misc.c
drm_legacy.h
drm_lock.c
drm_managed.c
drm_memory.c
drm_mipi_dbi.c
drm_mipi_dsi.c
drm_mm.c
drm_mode_config.c
drm_mode_object.c
drm_modes.c treewide: Change list_sort to use const pointers 2021-09-30 10:11:04 +02:00
drm_modeset_helper.c
drm_modeset_lock.c
drm_of.c drm/of: free the iterator object on failure 2021-09-15 09:50:32 +02:00
drm_panel_orientation_quirks.c drm: Add orientation quirk for GPD Win Max 2022-04-13 21:00:54 +02:00
drm_panel.c
drm_pci.c
drm_plane_helper.c drm/plane-helper: fix uninitialized variable reference 2021-11-18 14:04:22 +01:00
drm_plane.c
drm_prime.c
drm_print.c
drm_probe_helper.c drm/probe-helper: Check epoch counter in output_poll_execute() 2021-05-14 09:50:23 +02:00
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: Deal with signalled fences in drm_syncobj_find_fence. 2021-12-14 11:32:39 +01:00
drm_sysfs.c
drm_trace_points.c
drm_trace.h
drm_vblank_work.c
drm_vblank.c
drm_vm.c
drm_vma_manager.c
drm_writeback.c
Kconfig drm/radeon: fix AGP dependency 2021-03-30 14:31:51 +02:00
Makefile