linux/drivers/auxdisplay
Guangshuo Li 7f138de156 auxdisplay: line-display: fix NULL dereference in linedisp_release
linedisp_release() currently retrieves the enclosing struct linedisp via
to_linedisp(). That lookup depends on the attachment list, but the
attachment may already have been removed before put_device() invokes the
release callback. This can happen in linedisp_unregister(), and can also
be reached from some linedisp_register() error paths.

In that case, to_linedisp() returns NULL and linedisp_release()
dereferences it while freeing the display resources.

The struct device released here is the embedded linedisp->dev used by
linedisp_register(), so retrieve the enclosing object directly with
container_of() instead.

Fixes: 66c9380948 ("auxdisplay: linedisp: encapsulate container_of usage within to_linedisp")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2026-03-27 09:54:31 +01:00
..
Kconfig auxdisplay: MAX6959 should select BITREVERSE 2025-02-20 14:43:58 +02:00
Makefile auxdisplay: linedisp: Group display drivers together 2024-04-02 19:09:14 +03:00
arm-charlcd.c auxdisplay: arm-charlcd: Remove redundant ternary operators 2025-12-29 14:52:19 +01:00
cfag12864b.c auxdisplay: Remove unused functions 2024-10-08 20:48:18 +03:00
cfag12864bfb.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
charlcd.c auxdisplay: charlcd: Partially revert "Move hwidth and bwidth to struct hd44780_common" 2025-03-10 18:02:31 +02:00
charlcd.h auxdisplay: charlcd: Partially revert "Move hwidth and bwidth to struct hd44780_common" 2025-03-10 18:02:31 +02:00
hd44780.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hd44780_common.c kernel.h: drop hex.h and update all hex.h users 2026-01-20 19:44:19 -08:00
hd44780_common.h auxdisplay: hd44780: Call charlcd_alloc() from hd44780_common_alloc() 2025-03-10 18:03:02 +02:00
ht16k33.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
img-ascii-lcd.c auxdisplay: img-ascii-lcd: Constify struct img_ascii_lcd_config 2024-12-10 22:26:33 +02:00
ks0108.c parport: Remove parport_driver.devmodel 2024-07-03 16:44:22 +02:00
lcd2s.c auxdisplay: lcd2s: add error handling for i2c transfers 2026-03-13 11:00:06 +01:00
line-display.c auxdisplay: line-display: fix NULL dereference in linedisp_release 2026-03-27 09:54:31 +01:00
line-display.h auxdisplay: linedisp: support attribute attachment to auxdisplay devices 2025-10-15 18:46:01 +02:00
max6959.c auxdisplay: max6959: Replace slab.h with device/devres.h 2026-01-13 12:08:12 +01:00
panel.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
seg-led-gpio.c auxdisplay: seg-led-gpio: use gpiod_multi_set_value_cansleep 2025-02-12 12:52:17 +02:00