Question about possible NULL Pointer Dereference in hx83102_get_modes()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Developers for DRM PANEL DRIVERS,

We are developing a static analyzer for Linux Kernel, and we are
curious about the function drm_mode_duplicate() in
hx83102_get_modes().
https://elixir.bootlin.com/linux/v6.12-rc2/source/drivers/gpu/drm/panel/panel-himax-hx83102.c#L567

```

struct drm_display_mode *mode;

mode = drm_mode_duplicate(connector->dev, m);

mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;

```

drm_mode_duplicate() will return NULL if it fails to allocate memory,
so NULL check is necessary for this function.
Directly accessing 'mode->type' may lead to NULL Pointer Dereference.

Please kindly correct us if we missed any key information. Looking
forward to your response!
We can help provide a patch if it's a true bug.

Best regards,
Zichen



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux